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.

Showing 1-2 of 2 results.

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

Original entry on oeis.org

22, 55, 77, 99, 132, 187, 286, 1056, 1463, 1474, 1606, 1837, 2277, 2981, 4785, 4851, 5313, 5588, 5929, 7227, 8272, 8415, 8492, 8954, 11517, 12573, 12628, 13156, 14883, 15972, 17688, 22066, 23936, 24915, 25850, 27522, 34045, 36289, 36806, 38489, 40744, 43450, 46794, 48092
Offset: 1

Views

Author

Anthony Sand, Jun 23 2014

Keywords

Comments

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.
n such that A000312(n) is in A135499. - Robert Israel, Jul 13 2014
All terms are multiples of 11. This follows from the divisibility rule for 11. - Jens Kruse Andersen, Jul 13 2014
Number of terms less than 10^k: 0, 4, 7, 24, 55, 135, ..., . - Robert G. Wilson v, Jul 18 2014
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

Examples

			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.
		

Crossrefs

Programs

  • Maple
    filter:= proc(n) local x,j;
       x:= convert(n^n,base,10);
       evalb(add((-1)^j*x[j],j=1..nops(x)) = 0)
    end proc;
    select(filter, 11 * [$1..1000]); # Robert Israel, Jul 13 2014
  • Mathematica
    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 *)
  • PARI
    isok(n) = d = digits(n^n) ; sum(i=1, #d, d[i]*(-1)^i) == 0; \\ Michel Marcus, Jun 25 2014

Formula

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;

Extensions

a(9)-a(24) from Michel Marcus, Jun 23 2014
a(25)-a(44) from Robert G. Wilson v, Jul 13 2014

A245387 Numbers k for which the alternating sum of the digits of k^k is +-1.

Original entry on oeis.org

1, 5, 10, 20, 21, 43, 56, 78, 80, 100, 131, 160, 170, 215, 230, 300, 355, 485, 505, 540, 692, 824, 1000, 1055, 1165, 1335, 1340, 1429, 1453, 1505, 1739, 2102, 2309, 2740, 2936, 3772, 3972, 4055, 4489, 4676, 5080, 5512, 5600, 5660, 5700, 5770, 5796, 6350, 7173, 7512, 7790, 8372, 9380, 9767, 10000
Offset: 1

Views

Author

Anthony Sand and Robert G. Wilson v, Jul 20 2014

Keywords

Comments

k may be present only if k^k == +-1 (mod 11).

Examples

			5 is a member since 5^5 = 3125 -> 3 - 1 + 2 - 5 = -1.
		

Crossrefs

Programs

  • Mathematica
    fQ[n_] := Block[{id = IntegerDigits[n^n]}, Abs[ Sum[id[[i]]*(-1)^i, {i, Length@ id}]] == 1]; k = 1; lst = {}; While[k < 10001, If[ fQ@ k, AppendTo[lst, k]]; k++]; lst
  • PARI
    is(n)=n=digits((n/10^valuation(n,10))^n); abs(sum(i=1,#n,(-1)^i*n[i]))==1
    forstep(n=1,1e6,[4, 5, 2, 3, 5, 1, 2, 2, 5, 2, 2, 1, 5, 3, 2, 5, 4, 2, 4, 5, 2, 3, 5, 1, 2, 2, 5, 2, 2, 1, 5, 3, 2, 5, 4, 2], if(is(n), print1(n", "))) \\ Charles R Greathouse IV, Jul 22 2014
Showing 1-2 of 2 results.