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-3 of 3 results.

A328882 a(n) = n - 2^(sum of digits of n).

Original entry on oeis.org

-1, -1, -2, -5, -12, -27, -58, -121, -248, -503, 8, 7, 4, -3, -18, -49, -112, -239, -494, -1005, 16, 13, 6, -9, -40, -103, -230, -485, -996, -2019, 22, 15, 0, -31, -94, -221, -476, -987, -2010, -4057, 24, 9, -22, -85, -212, -467, -978, -2001, -4048, -8143, 18, -13, -76, -203, -458, -969, -1992, -4039, -8134, -16325, -4
Offset: 0

Views

Author

Yusuf Gurtas, Oct 29 2019

Keywords

Comments

This sequence is a map from the set of nonnegative integers into the set of all integers. It is clearly not one-to-one. It is not known if it is onto.
Comments from N. J. A. Sloane, Nov 17 2019: (Start)
For m >= 0, A329002 gives an expression for the first time that m appears in this sequence (if it does appear), and A329492 plays a similar role for negative m.
In all these sequences it is safer to say "sum of digits" (which is A007953) rather than "digital sum" (which is also A007953), because many people confuse the latter term with the "digital root" (A010888). (End)

Examples

			a(0) = 0 - 2^0 = -1.
a(11) = 11 - 2^(1+1) = 7.
a(32) = 32 - 2^(3+2) = 0. The next time 0 occurs is at a(1180591620717411303424) = 1180591620717411303424 - 2^(70)=0.
The only known occurrence of 1 is when n=513: a(513) = 513 - 2^(5+1+3) = 1.
Smallest n such that a(n) = k, from _N. J. A. Sloane_, Nov 16 2019:
k = 0    1       2     3  4   5  6  7  8  9  10 ...
n = 32 513 2^103+2  1027 12 133 22 11 10 41 522 ...
k = -1 -2 -3 -4 -5   -6      -7  -8 -9     -10 11 ...
n =  0  2 13 60  3 1018 2^103-7 504 23 2^18-10  ? ...
		

Crossrefs

Cf. A007953 (sum of digits of n), A329002, A329492, A329493.
Cf. also A007953, A010888.

Programs

  • Mathematica
    Array[# - 2^Total[IntegerDigits@ #] &, 61, 0] (* Michael De Vlieger, Oct 30 2019 *)
  • PARI
    a(n) = n - 2^sumdigits(n); \\ Michel Marcus, Oct 30 2019

Formula

a(n) = n - 2^A007953(n).

Extensions

More terms from Michel Marcus, Oct 30 2019

A329002 a(n) is the smallest d such that the sum of digits of 2^d + n is equal to d, or -1 if no such d exists.

Original entry on oeis.org

5, 9, 103, 10, 3, 7, 4, 2, 1, 5, 9, 12, 10, 3, 7, 4, 2, 18, 5, 9, 12, 10, 3, 7, 4, 20, 18, 70, 9, 12, 10
Offset: 0

Views

Author

N. J. A. Sloane, Nov 16 2019

Keywords

Comments

The first open case is 31. If a(31) is not -1, then it is at least 20000.
If a(i) = m > 0 then A328882 takes the value i for the first time at term 2^m+i. For example, the first appearance of 2 in A328882 is at term 2^103 + 2.
From Yusuf Gurtas, Dec 27 2019: (Start)
a(n)=1 if and only if n+2 is a positive integer whose sum of digits is 1. Since the only such numbers are 10^k the only solutions to a(n)=1 are n=10^k-2 for k=1,2,... In other words, a(n)=1 if and only if n = 8, 98, 998, 9998, 99998, 999998, .... In particular, a(n)=1 has infinitely many solutions.
Using the same idea, a(n)=2 can be solved. a(n)=2 if and only if n + 2^2 = n + 4 is a positive integer whose sum of digits is 2. Since the only such numbers are 2*10^k or 10^j*(10^k+1) for j=0,1,2,..., k=1,2,3,..., the only solutions to a(n)=2 are n = 10^j*(10^k+1) - 4 for j=0,1,2,..., k=1,2,3,.... The first 30 solutions are n = 7, 16, 97, 106, 196, 997, 1006, 1096, 1996, 9997, 10006, 10096, 10996, 19996, 99997, 100006, 100096, 100996, 109996, 199996, 999997, 1000006, 1000096, 1000996, 1009996, 1099996, 1999996, 9999997, 10000006, 10000096.
(End)

Examples

			n=1: 2^9 + 1 = 513 has digit sum 9, so a(1) = 9.
n=2: 2^103 + 2 has digit sum 103, and no smaller number has this property, so a(2) = 103.
		

Crossrefs

Programs

  • Mathematica
    Array[Block[{d = 1}, While[Total@ IntegerDigits[2^d + #] != d, d++]; d] &, 31, 0] (* Michael De Vlieger, Dec 29 2019 *)
  • PARI
    a(n) = my(d=1); while (sumdigits(2^d+n) != d, d++); d; \\ Michel Marcus, Nov 12 2023

A329493 (Sum of digits of (2^n - 11)) - n.

Original entry on oeis.org

1, -2, 2, 2, 3, -3, -5, 1, 5, 5, 6, 9, 7, -5, -1, 8, 9, 3, 10, 25, 11, 2, 12, 6, 13, 10, 5, 14, 24, 27, 25, 22, 26, 17, 27, 30, 19, 7, 11, 20, 12, 15, 22, 19, 23, 14, 24, 27, 25, 22, 26, 35, 27, 21, 10, 16, 20, 11, 30, 33, 22, 19, 41, 41, 33, 18, -2, 13, 35, 35, 54, 48, 28, 25, 20, 29, 30
Offset: 4

Views

Author

N. J. A. Sloane, Nov 16 2019

Keywords

Comments

Is this ever zero? If not, this would prove that A329492(11) = -1, and that A328882 is never -11. (-11 is the first negative open case.)

Crossrefs

Programs

  • Maple
    f:= proc(n) convert(convert(2^n-11,base,10),`+`)-n end proc:
    map(f, [$4..100]); # Robert Israel, Nov 17 2019
  • Mathematica
    Table[Total[IntegerDigits[2^n-11]]-n,{n,4,90}] (* Harvey P. Dale, Oct 13 2024 *)
Showing 1-3 of 3 results.