cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A244212 Numbers n for which the alternating sum of the digits of n^n is 0.

This page as a plain text file.
%I A244212 #78 Jun 13 2018 13:36:06
%S A244212 22,55,77,99,132,187,286,1056,1463,1474,1606,1837,2277,2981,4785,4851,
%T A244212 5313,5588,5929,7227,8272,8415,8492,8954,11517,12573,12628,13156,
%U A244212 14883,15972,17688,22066,23936,24915,25850,27522,34045,36289,36806,38489,40744,43450,46794,48092
%N A244212 Numbers n for which the alternating sum of the digits of n^n is 0.
%C A244212 The result of alternately adding and subtracting the digits of n sometimes differs in sign when the procedure goes from left to right or right to left. For example, if n = 1234, 1 - 2 + 3 - 4 = -2, whereas 4 - 3 + 2 - 1 = +2. However, if the sum is zero when adding and subtracting from left to right, it will also be zero when adding and subtracting from right to left.
%C A244212 n such that A000312(n) is in A135499. - _Robert Israel_, Jul 13 2014
%C A244212 All terms are multiples of 11. This follows from the divisibility rule for 11. - _Jens Kruse Andersen_, Jul 13 2014
%C A244212 Number of terms less than 10^k: 0, 4, 7, 24, 55, 135, ..., . - _Robert G. Wilson v_, Jul 18 2014
%C A244212 Numbers for which the alternating sum of the digits of n^n are == 0 (Mod 10): 12, 22, 23, 35, 45, 46, 47, 55, 57, 77, 99, 117, 126, 132, 151, ..., . Obviously the members of A244212 are included here. - _Robert G. Wilson v_, Jul 20 2014
%H A244212 Jens Kruse Andersen and Robert G. Wilson v, <a href="/A244212/b244212.txt">Table of n, a(n) for n = 1..139</a> (a(48) to a(63) from Jens Kruse Andersen).
%F A244212 s = 0; m = 1; for digit[n,i=1..j] of n, s = s + digit[i] * m; m = -m; next i; if s = 0, print n;
%e A244212 22^22 = 341427877364219557396646723584, therefore the alternating sum = 4 - 8 + 5 - 3 + 2 - 7 + 6 - 4 + 6 - 6 + 9 - 3 + 7 - 5 + 5 - 9 + 1 - 2 + 4 - 6 + 3 - 7 + 7 - 8 + 7 - 2 + 4 - 1 + 4 - 3 = 0.
%p A244212 filter:= proc(n) local x,j;
%p A244212    x:= convert(n^n,base,10);
%p A244212    evalb(add((-1)^j*x[j],j=1..nops(x)) = 0)
%p A244212 end proc;
%p A244212 select(filter, 11 * [$1..1000]); # _Robert Israel_, Jul 13 2014
%t A244212 fQ[n_] := Block[{id = IntegerDigits[ n^n]}, Sum[ id[[i]]*(-1)^i, {i, Length@ id}] == 0]; k = 11; lst = {}; While[k < 100001, If[ fQ@ k, AppendTo[ lst, k]; Print@ k]; k+= 11]; lst (* _Robert G. Wilson v_, Jul 13 2014 *)
%o A244212 (PARI) isok(n) = d = digits(n^n) ; sum(i=1, #d, d[i]*(-1)^i) == 0; \\ _Michel Marcus_, Jun 25 2014
%Y A244212 Cf. A000312, A065816, A135499, A244144.
%K A244212 nonn,base
%O A244212 1,1
%A A244212 _Anthony Sand_, Jun 23 2014
%E A244212 a(9)-a(24) from _Michel Marcus_, Jun 23 2014
%E A244212 a(25)-a(44) from _Robert G. Wilson v_, Jul 13 2014