login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Search: a004207 -id:a004207
Displaying 1-10 of 66 results found. page 1 2 3 4 5 6 7
     Sort: relevance | references | number | modified | created      Format: long | short | data
A230107 Define a sequence by b(1)=n, b(k+1)=b(k)+(sum of digits of b(k)); a(n) is the number of steps needed to reach a term in A004207, or a(n) = -1 if the sequence never joins A004207. +20
4
0, 0, -1, 0, 52, -1, 11, 0, -1, 51, 50, -1, 49, 10, -1, 0, 48, -1, 9, 50, -1, 49, 0, -1, 47, 48, -1, 0, 8, -1, 49, 46, -1, 47, 48, -1, 45, 0, -1, 7, 46, -1, 47, 6, -1, 45, 44, -1, 0, 46, -1, 5, 5, -1, 45, 44, -1, 43, 4, -1, 4, 0, -1, 4, 44, -1, 43, 3, -1, 0 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,5
COMMENTS
Looking at b(k) mod 9 shows that a(n) = -1 whenever n is a multiple of 3 (since then the b sequence is disjoint from A004207).
Conjecture: the b sequence, for any starting value n, will eventually merge with one of A000004 (the zero sequence), A004207, A016052 or A016096.
LINKS
EXAMPLE
For n=3, A016052 never meets A004207, so a(3) = -1.
For n=5, A007618 meets A004207 at the 53rd term, 620, so a(5) = 53.
MAPLE
read transforms; # to get digsum
M:=2000;
# f(s) returns the sequence k->k+digsum(k) starting at s
f:=proc(s) global M; option remember; local n, k, s1;
s1:=[s]; k:=s;
for n from 1 to M do k:=k+digsum(k);
s1:=[op(s1), k]; od: end;
# g(s) returns (x, p), where x = first number in common between
# f(1) and f(s), and p is the position where it occurred.
# If f(1), f(s) are disjoint for M terms, returns (-1, -1)
S1:=convert(f(1), set):
g:=proc(s) global f, S1; local t1, p, S2, S3;
S2:=convert(f(s), set);
S3:= S1 intersect S2;
t1:=min(S3);
if (t1 = infinity) then RETURN(-1, -1); else
member(t1, f(s), 'p'); RETURN(t1, p-1); fi;
end;
[seq(g(n)[2], n=1..20)];
PROG
(Haskell)
import Data.Maybe (fromMaybe)
a230107 = fromMaybe (-1) . f (10^5) 1 1 1 where
f k i u j v | k <= 0 = Nothing
| u < v = f (k - 1) (i + 1) (a062028 u) j v
| u > v = f (k - 1) i u (j + 1) (a062028 v)
| otherwise = Just j
CROSSREFS
KEYWORD
sign,base
AUTHOR
N. J. A. Sloane and Reinhard Zumkeller, Oct 15 2013; corrected Oct 20 2013
STATUS
approved
A176718 Partial sums of A004207. +20
1
1, 2, 4, 8, 16, 32, 55, 83, 121, 170, 232, 302, 379, 470, 571, 674, 781, 896, 1018, 1145, 1282, 1430, 1591, 1760, 1945, 2144, 2362, 2591, 2833, 3083, 3340, 3611, 3892, 4184, 4489, 4802, 5122, 5447, 5782, 6128, 6487, 6863, 7255, 7661, 8077, 8504, 8944, 9392 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,2
COMMENTS
Partial sums of a(1) = 1, a(n) = sum of digits of all previous terms. The subsequence of primes in this sequence begins: 2, 83, 379, 571, 2591, 2833, 3083, 6863, 10831. The subsequence of squares in this sequence begins: 1, 4, 16, 121, 4489.
LINKS
FORMULA
a(n) = SUM[i=0..n] A004207(i) = SUM[i=0..n] {b(1) = 1, b(j) = sum of digits of b(j) for j = 0..i} = SUM[i=0..n] {b(1) = 1, b(k) = A007953(b(k)) for k = 0..i}.
EXAMPLE
a(7) = 1 + 1 + 2 + 4 + 8 + 16 + 23 + 28 = 83 is prime.
MAPLE
A176718 := proc(n)
add( A004207(k), k=0..n) ;
end proc: # R. J. Mathar, Apr 02 2014
CROSSREFS
KEYWORD
base,easy,nonn
AUTHOR
Jonathan Vos Post, Apr 25 2010
STATUS
approved
A062028 a(n) = n + sum of the digits of n. +10
76
0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 33, 35, 37, 39, 41, 43, 45, 47, 49, 51, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 55, 57, 59, 61, 63, 65, 67, 69, 71, 73, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 77 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,2
COMMENTS
a(n) = A248110(n,A007953(n)). - Reinhard Zumkeller, Oct 01 2014
LINKS
Harry J. Smith and N. J. A. Sloane, Table of n, a(n) for n = 0..10000 (first 1000 terms were computed by Harry J. Smith)
FORMULA
a(n) = n + A007953(n).
a(n) = A160939(n+1) - 1. - Filip Zaludek, Oct 26 2016
EXAMPLE
a(34) = 34 + 3 + 4 = 41, a(40) = 40 + 4 = 44.
MAPLE
with(numtheory): for n from 1 to 100 do a := convert(n, base, 10):
c := add(a[i], i=1..nops(a)): printf(`%d, `, n+c); od:
A062028 := n -> n+add(i, i=convert(n, base, 10)) # M. F. Hasler, Nov 08 2018
MATHEMATICA
Table[n + Total[IntegerDigits[n]], {n, 0, 100}]
PROG
(PARI) SumD(x)={ s=0; while (x>9, s=s+x-10*(x\10); x\=10); s+x }
for(n=0, 1000, write("b062028.txt", n, " ", n + SumD(n))) \\ Harry J. Smith, Jul 30 2009
(PARI) A062028(n)=n+sumdigits(n) \\ M. F. Hasler, Jul 19 2015
(Haskell) a062028 n = a007953 n + n -- Reinhard Zumkeller, Oct 11 2013
(Python)
def a(n): return n + sum(map(int, str(n)))
print([a(n) for n in range(71)]) # Michael S. Branicky, Jan 09 2023
CROSSREFS
Indices of: A047791 (primes), A107743 (composites), A066564 (squares), A084661 (cubes).
Iterations: A004207 (start=1), A016052 (start=3), A007618 (start=5), A006507 (start=7), A016096 (start=9).
KEYWORD
nonn,base,easy
AUTHOR
Amarnath Murthy, Jun 02 2001
EXTENSIONS
More terms from Vladeta Jovovic, Jun 05 2001
STATUS
approved
A001370 Sum of digits of 2^n.
(Formerly M1085 N0414)
+10
42
1, 2, 4, 8, 7, 5, 10, 11, 13, 8, 7, 14, 19, 20, 22, 26, 25, 14, 19, 29, 31, 26, 25, 41, 37, 29, 40, 35, 43, 41, 37, 47, 58, 62, 61, 59, 64, 56, 67, 71, 61, 50, 46, 56, 58, 62, 70, 68, 73, 65, 76, 80, 79, 77, 82, 92, 85, 80, 70, 77 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,2
COMMENTS
Same digital roots as A065075 (sum of digits of the sum of the preceding numbers) and A004207 (sum of digits of all previous terms); they enter into the cycle {1 2 4 8 7 5}. - Alexandre Wajnberg, Dec 11 2005
It is believed that a(n) ~ n*9*log_10(2)/2, but this is an open problem. - N. J. A. Sloane, Apr 21 2013
The Radcliffe preprint shows that a(n) > log_4(n). - M. F. Hasler, May 18 2017
Sierpiński shows that if n >= A137284(k-1) then a(n) >= k (Problem 209). - David Radcliffe, Dec 26 2022
REFERENCES
Archimedeans Problems Drive, Eureka, 26 (1963), 12.
N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
LINKS
David Radcliffe, The growth of digital sums of powers of two. Preprint, 2015.
David G. Radcliffe, The growth of digital sums of powers of two, arXiv:1605.02839 [math.NT], 2016.
C. L. Stewart, On the representation of an integer in two different bases, Journal für die reine und angewandte Mathematik 319 (1980): 63-72.
FORMULA
a(n) = A007953(A000079(n)). - Michel Marcus, Nov 01 2013
MAPLE
seq(convert(convert(2^n, base, 10), `+`), n=0..1000); # Robert Israel, Mar 29 2015
MATHEMATICA
Table[Total[IntegerDigits[2^n]], {n, 0, 55}] (* Vincenzo Librandi, Oct 08 2013 *)
PROG
(PARI) a(n)=sumdigits(2^n); \\ Michel Marcus, Nov 01 2013
(Python) [sum(map(int, str(2**n))) for n in range(56)] # David Radcliffe, Mar 29 2015
(Haskell)
a001370 = a007953 . a000079 -- Reinhard Zumkeller, Aug 14 2015
CROSSREFS
Cf. sum of digits of k^n: A004166 (k=3), A065713 (k=4), A066001(k=5), A066002 (k=6), A066003(k=7), A066004 (k=8), A065999 (k=9), A066005 (k=11), A066006 (k=12).
KEYWORD
base,easy,nonn
AUTHOR
STATUS
approved
A010062 a(0)=1; thereafter a(n+1) = a(n) + number of 1's in binary representation of a(n). +10
34
1, 2, 3, 5, 7, 10, 12, 14, 17, 19, 22, 25, 28, 31, 36, 38, 41, 44, 47, 52, 55, 60, 64, 65, 67, 70, 73, 76, 79, 84, 87, 92, 96, 98, 101, 105, 109, 114, 118, 123, 129, 131, 134, 137, 140, 143, 148, 151, 156, 160, 162, 165, 169, 173, 178, 182, 187, 193, 196, 199, 204 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,2
COMMENTS
Sequence A230297 (and A157845 without initial term) converted from binary to decimal, cf. formula. - M. F. Hasler, Nov 18 2019
LINKS
Raoul Nakhmanson-Kulish, Graph of a(n)/(n*log_2(n)/2), showing self-similar fractal structure.
Raoul Nakhmanson-Kulish, Graph of f(n), where f(n) = (a(n)-n*log_2(n)/2)/(n*sqrt(log_2(n)*log_2 log_2(n))) (see Stolarsky's estimate below).
Kenneth B. Stolarsky, The sum of a digitaddition series, Proc. Amer. Math. Soc. 59 (1976), no. 1, 1--5. MR0409340 (53 #13099)
FORMULA
a(n) = (n/2)*log n + O(n*sqrt(log n * loglog n)), where log means log_2. In particular, a(n) ~ (n/2)*log n. [Stolarsky]
a(n + 1) = A092391(a(n)) = a(n) + A000120(a(n)). - Reinhard Zumkeller, May 27 2012, May 08 2004; corrected thanks to a notice by Lambert Herrgesell
a(n) = A028897(A230297(n)) = A028897(A157845(n+1)). - M. F. Hasler, Nov 18 2019
EXAMPLE
a(7) = 14 because a(6) = 12, which is 1100 in binary (having 2 on bits), and 12 + 2 = 14.
a(8) = 17 because a(7) = 14, which is 1110 in binary (having 3 on bits), and 14 + 3 = 17.
MATHEMATICA
NestList[# + DigitCount[#, 2, 1] &, 1, 60] (* Alonso del Arte, Oct 26 2012 *)
PROG
(PARI) print1(s=1); for(n=2, 30, print1(", ", s+=hammingweight(s))) \\ Charles R Greathouse IV, Oct 27 2012
(PARI) A010062=List(1); A010062(n)={for(n=#A010062, n, listput(A010062, A092391(A010062[n]))); A010062[n+1]} \\ A092391(n)=n+hammingweight(n). - M. F. Hasler, Nov 18 2019
(Haskell)
a010062 n = a010062_list !! n
a010062_list = iterate a092391 1 -- Reinhard Zumkeller, May 13 2012
(Magma) [n le 1 select 1 else Self(n-1)+&+Intseq(Self(n-1), 2): n in [1..61]]; // Bruno Berselli, Oct 27 2012
(Python)
from itertools import islice
def agen():
an = 1
while True: yield an; an += an.bit_count()
print(list(islice(agen(), 61))) # Michael S. Branicky, Jul 31 2022
CROSSREFS
First row of A228083.
For the base-10 analog see A004207.
Cf. A000120, A010061, A092391, A229167, A096303, A229743, A229744, A230297 (this sequence written in binary), A230298 (read mod 2).
See A230088 for partial sums.
Equals A028897 o A230297 = A028897 o A157845 (up to offset); see also A007088.
KEYWORD
nonn,base,easy,nice
AUTHOR
Leonid Broukhis, Mar 15 1996
EXTENSIONS
More terms from Benoit Cloitre, Jun 02 2002
Stolarsky reference from Matthew C. Russell, Oct 08 2013
STATUS
approved
A037123 a(n) = a(n-1) + sum of digits of n. +10
32
0, 1, 3, 6, 10, 15, 21, 28, 36, 45, 46, 48, 51, 55, 60, 66, 73, 81, 90, 100, 102, 105, 109, 114, 120, 127, 135, 144, 154, 165, 168, 172, 177, 183, 190, 198, 207, 217, 228, 240, 244, 249, 255, 262, 270, 279, 289, 300, 312, 325, 330, 336, 343, 351, 360, 370, 381 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,3
COMMENTS
Sum of digits of A007908(n). - Franz Vrabec, Oct 22 2007
Also digital sum of A138793(n) for n > 0. - Bruno Berselli, May 27 2011
Sum of the digital sum of i for i from 0 to n. - N. J. A. Sloane, Nov 13 2013
REFERENCES
N. Agronomof, Sobre una función numérica, Revista Mat. Hispano-Americana 1 (1926), 267-269.
Maurice d'Ocagne, Sur certaines sommations arithmétiques, J. Sciencias Mathematicas e Astronomicas 7 (1886), 117-128.
LINKS
P.-H. Cheo and S.-C. Yien, A problem on the k-adic representation of positive integers, Acta Math. Sinica 5, 433-438 (1955).
J. Coquet, Power sums of digital sums, J. Number Theory 22 (1986), no. 2, 161-176.
H. Delange, Sur la fonction sommatoire de la fonction "somme des chiffres", Enseignement Math. (2) 21 (1975), 31-47.
P. J. Grabner, P. Kirschenhofer, H. Prodinger and R. F. Tichy, On the moments of the sum-of-digits function, Applications of Fibonacci numbers, Vol. 5 (St. Andrews, 1992), Kluwer Acad. Publ., Dordrecht, 1993, 263-271.
Hsien-Kuei Hwang, S. Janson, and T.-H. Tsai, Exact and Asymptotic Solutions of a Divide-and-Conquer Recurrence Dividing at Half: Theory and Applications, ACM Transactions on Algorithms, 13:4 (2017), #47; DOI: 10.1145/3127585.
J.-L. Mauclaire and Leo Murata, On q-additive functions, I. Proc. Japan Acad. Ser. A Math. Sci. 59 (1983), no. 6, 274-276.
J.-L. Mauclaire and Leo Murata, On q-additive functions, II. Proc. Japan Acad. Ser. A Math. Sci. 59 (1983), no. 9, 441-444.
H. Riede, Asymptotic estimation of a sum of digits, Fibonacci Q. 36, No. 1, 72-75 (1998).
J. R. Trollope, An explicit expression for binary digital sums, Math. Mag. 41 1968 21-25.
FORMULA
a(n) = Sum_{k=0..n} s(k) = Sum_{k=0..n} A007953(k), where s(k) denote the sum of the digits of k in decimal representation. Asymptotic expression: a(n-1) = Sum_{k=0..n-1} s(k) = 4.5*n*log_10(n) + O(n). - Antonio G. Astudillo (afg_astudillo(AT)hotmail.com), Sep 07 2002
a(n) = n*(n+1)/2 - 9*Sum_{k=1..n} Sum_{i=1..ceiling(log_10(k))} floor(k/10^i). - Benoit Cloitre, Aug 28 2003
From Hieronymus Fischer, Jul 11 2007: (Start)
G.f.: Sum_{k>=1} ((x^k - x^(k+10^k) - 9x^(10^k))/(1-x^(10^k)))/(1-x)^2.
a(n) = (1/2)*((n+1)*(n - 18*Sum_{k>=1} floor(n/10^k)) + 9*Sum_{k>=1} (1 + floor(n/10^k))*floor(n/10^k)*10^k).
a(n) = (1/2)*((n+1)*(2*A007953(n)-n) + 9*Sum_{k>=1} (1+floor(n/10^k))*floor(n/10^k)*10^k). (End)
a(n) = A007953(A053064(n)). - Reinhard Zumkeller, Oct 10 2008
From Wojciech Raszka, Jun 14 2019: (Start)
a(10^k - 1) = 10*a(10^(k - 1) - 1) + 45*10^(k - 1) for k > 0.
a(n) = a(n mod m) + MSD*a(m - 1) + (MSD*(MSD - 1)/2)*m + MSD*((n mod m) + 1), where m = 10^(A055642(n) - 1), MSD = A000030(n). (End)
MAPLE
# From N. J. A. Sloane, Nov 13 2013:
digsum:=proc(n, B) local a; a := convert(n, base, B):
add(a[i], i=1..nops(a)): end;
f:=proc(n, k, B) global digsum; local i;
add( digsum(i, B)^k, i=0..n); end;
lprint([seq(digsum(n, 10), n=0..100)]); # A007953
lprint([seq(f(n, 1, 10), n=0..100)]); #A037123
lprint([seq(f(n, 2, 10), n=0..100)]); #A074784
lprint([seq(f(n, 3, 10), n=0..100)]); #A231688
lprint([seq(f(n, 4, 10), n=0..100)]); #A231689
MATHEMATICA
Table[Plus@@Flatten[IntegerDigits[Range[n]]], {n, 0, 200}] (* Enrique Pérez Herrero, Oct 12 2015 *)
a[0] = 0; a[n_] := a[n - 1] + Plus @@ IntegerDigits@ n; Array[a, 70, 0] (* Robert G. Wilson v, Jul 06 2018 *)
PROG
(PARI) a(n)=n*(n+1)/2-9*sum(k=1, n, sum(i=1, ceil(log(k)/log(10)), floor(k/10^i)))
(PARI) a(n)={n++; my(t, i, s); c=n; while(c!=0, i++; c\=10); for(j=1, i, d=(n\10^(i-j))%10; t+=(10^(i-j)*(s*d+binomial(d, 2)+d*9*(i-j)/2)); s+=d); t} \\ David A. Corneth, Aug 16 2013
(Perl) for $i (0..100){ @j = split "", $i; for (@j){ $sum += $_; } print "$sum, "; } __END__ # gamo(AT)telecable.es
(Magma) [ n eq 0 select 0 else &+[&+Intseq(k): k in [0..n]]: n in [0..56] ]; // Bruno Berselli, May 27 2011
CROSSREFS
Cf. also A074784, A231688, A231689.
Partial sums of A007953.
KEYWORD
nonn,base,easy
AUTHOR
Vasiliy Danilov (danilovv(AT)usa.net), Jun 15 1998
EXTENSIONS
More terms from Antonio G. Astudillo (afg_astudillo(AT)hotmail.com), Sep 07 2002
STATUS
approved
A016052 a(1) = 3; for n >= 1, a(n+1) = a(n) + sum of its digits. +10
25
3, 6, 12, 15, 21, 24, 30, 33, 39, 51, 57, 69, 84, 96, 111, 114, 120, 123, 129, 141, 147, 159, 174, 186, 201, 204, 210, 213, 219, 231, 237, 249, 264, 276, 291, 303, 309, 321, 327, 339, 354, 366, 381, 393, 408, 420, 426, 438, 453, 465, 480, 492 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
Mod 9 this sequence is 3, 6, 3, 6, 3, 6, ... This shows that this sequence is disjoint from A004207. - N. J. A. Sloane, Oct 15 2013
REFERENCES
D. R. Kaprekar, Puzzles of the Self-Numbers. 311 Devlali Camp, Devlali, India, 1959.
D. R. Kaprekar, The Mathematics of the New Self Numbers, Privately printed, 311 Devlali Camp, Devlali, India, 1963.
G. E. Stevens and L. G. Hunsberger, A Result and a Conjecture on Digit Sum Sequences, J. Recreational Math. 27, no. 4 (1995), pp. 285-288.
LINKS
D. R. Kaprekar, The Mathematics of the New Self Numbers [annotated and scanned]
FORMULA
a(n) = A062028(a(n-1)) for n > 1. - Reinhard Zumkeller, Oct 14 2013
a(n) - a(n-1) = A084228(n+1). - Robert G. Wilson v, Jun 27 2014
MATHEMATICA
NestList[# + Total[IntegerDigits[#]] &, 3, 51] (* Jayanta Basu, Aug 11 2013 *)
a[1] = 3; a[n_] := a[n] = a[n - 1] + Total@ IntegerDigits@ a[n - 1]; Array[a, 80] (* Robert G. Wilson v, Jun 27 2014 *)
PROG
(Haskell)
a016052 n = a016052_list !! (n-1)
a016052_list = iterate a062028 3 -- Reinhard Zumkeller, Oct 14 2013
(PARI)
a_list(nn) = { my(f(n, i) = n + vecsum(digits(n)), S=vector(nn+1)); S[1]=3; for(k=2, #S, S[k] = fold(f, S[1..k-1])); S[2..#S] } \\ Satish Bysany, Mar 04 2017
(Python)
from itertools import islice
def A016052_gen(): # generator of terms
yield (a:=3)
while True: yield (a:=a+sum(map(int, str(a))))
A016052_list = list(islice(A016052_gen(), 20)) # Chai Wah Wu, Jun 16 2024
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
STATUS
approved
A007618 a(n) = a(n-1) + sum of digits of a(n-1), a(1) = 5.
(Formerly M3792)
+10
23
5, 10, 11, 13, 17, 25, 32, 37, 47, 58, 71, 79, 95, 109, 119, 130, 134, 142, 149, 163, 173, 184, 197, 214, 221, 226, 236, 247, 260, 268, 284, 298, 317, 328, 341, 349, 365, 379, 398, 418, 431, 439, 455, 469, 488, 508, 521, 529, 545, 559, 578, 598, 620, 628, 644 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
a(n) = A004207(n+5) for n > 52. - Reinhard Zumkeller, Oct 14 2013
a(2) = 10 and a(590) = 10000 are the first two powers of 10 in this sequence; there are no others below a(19017393928) = 1000000000093. Conjecture: the sequence contains infinitely many powers of 10. - Charles R Greathouse IV, Mar 29 2022
REFERENCES
N. Agronomof, Problem 4421, L'Intermédiaire des mathématiciens, v. 21 (1914), p. 147. (Mentions sequence starting at 11.) - N. J. A. Sloane, Nov 22 2013.
D. R. Kaprekar, Puzzles of the Self-Numbers. 311 Devlali Camp, Devlali, India, 1959.
D. R. Kaprekar, The Mathematics of the New Self Numbers, Privately Printed, 311 Devlali Camp, Devlali, India, 1963.
J. Roberts, Lure of the Integers, Math. Assoc. America, 1992, p. 65.
N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
LINKS
D. R. Kaprekar, The Mathematics of the New Self Numbers [annotated and scanned]
FORMULA
a(n) = A062028(a(n-1)) for n > 1. - Reinhard Zumkeller, Oct 14 2013
PROG
(Haskell)
a007618 n = a007618_list !! (n-1)
a007618_list = iterate a062028 5 -- Reinhard Zumkeller, Oct 14 2013
(Python)
from itertools import accumulate
def f(an, _): return an + sum(int(d) for d in str(an))
print(list(accumulate([5]*55, f))) # Michael S. Branicky, May 10 2021
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
STATUS
approved
A230093 Number of values of k such that k + (sum of digits of k) is n. +10
22
1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 2, 1 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,102
COMMENTS
a(n) is the number of times n occurs in A062028.
For n>=1, a(10^n) = a(9*n-1). - Max Alekseyev, Feb 23 2021
LINKS
MAPLE
# Maple code for A062028, A230093, A003052, A225793, A230094.
with(LinearAlgebra):
read transforms; # to get digsum
M := 1000; A062028 := Array(0..M); A230093 := Array(0..M);
for n from 0 to M do
m := n+digsum(n);
A062028[n] := m;
if m <= M then A230093[m] := A230093[m]+1; fi;
od:
t1:=[seq(A062028[i], i=0..M)]; # A062028 as list (but incorrect offset 1)
t2:=[seq(A230093[i], i=0..M)]; # A230093 as list, but then a(0) has index 1
# A003052 := COMPl(t1); # COMPl has issues, may be incorrect for M <> 1000
ctmax:=4;
for h from 0 to ctmax do ct[h] := []; od:
for i from 1 to M do
h := lis2[i];
if h <= ctmax then ct[h] := [op(ct[h]), i]; fi;
od:
A225793 := ct[1]; A230094 := ct[2]; # A003052 := ct[0]; # see there for better code
MATHEMATICA
Module[{nn=110, a, b, c, d}, a=Tally[Table[x+Total[IntegerDigits[x]], {x, 0, nn}]]; b=a[[All, 1]]; c={#, 0}&/@Complement[Range[nn], b]; d=Sort[Join[a, c]]; d[[All, 2]]] (* Harvey P. Dale, Jun 12 2019 *)
PROG
(Haskell) a230093 n = length $ filter ((== n) . a062028) [n - 9 * a055642 n .. n] -- Reinhard Zumkeller, Oct 11 2013
(PARI) apply( A230093(n)=sum(i=n>0, min(9*logint(n+!n, 10)+8, n\2), sumdigits(n-i)==i), [1..150]) \\ M. F. Hasler, Nov 08 2018
CROSSREFS
Cf. A006064, A007953 (sum of digits), A062028 (n + sum of its digits), A004207, A228085, A003052, A176995, A225793, A230094, A055642.
Cf. A107740 (this applied to primes).
KEYWORD
nonn,base
AUTHOR
N. J. A. Sloane, Oct 10 2013
EXTENSIONS
Edited by M. F. Hasler, Nov 08 2018
STATUS
approved
A006507 a(n+1) = a(n) + sum of digits of a(n), with a(1)=7.
(Formerly M4348)
+10
20
7, 14, 19, 29, 40, 44, 52, 59, 73, 83, 94, 107, 115, 122, 127, 137, 148, 161, 169, 185, 199, 218, 229, 242, 250, 257, 271, 281, 292, 305, 313, 320, 325, 335, 346, 359, 376, 392, 406, 416, 427, 440, 448, 464, 478, 497, 517, 530, 538, 554, 568 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
a(n) = A004207(n+4) for n > 11. - Reinhard Zumkeller, Oct 14 2013
REFERENCES
Editorial Note, Popular Computing (Calabasas, CA), Vol. 4 (No. 37, Apr 1976), p. 12.
GCHQ, The GCHQ Puzzle Book, Penguin, 2016. See page 36.
D. R. Kaprekar, Puzzles of the Self-Numbers. 311 Devlali Camp, Devlali, India, 1959.
D. R. Kaprekar, The Mathematics of the New Self Numbers, Privately Printed, 311 Devlali Camp, Devlali, India, 1963.
Jeffrey Shallit, personal communication.
N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
LINKS
D. R. Kaprekar, The Mathematics of the New Self Numbers [annotated and scanned]
FORMULA
a(n) = A062028(a(n-1)) for n > 1. - Reinhard Zumkeller, Oct 14 2013
MATHEMATICA
NestList[#+Total[IntegerDigits[#]]&, 7, 50] (* Harvey P. Dale, Jan 25 2021 *)
PROG
(Haskell)
a006507 n = a006507_list !! (n-1)
a006507_list = iterate a062028 7 -- Reinhard Zumkeller, Oct 14 2013
CROSSREFS
KEYWORD
base,nonn
AUTHOR
EXTENSIONS
More terms from Robert G. Wilson v
STATUS
approved
page 1 2 3 4 5 6 7

Search completed in 0.029 seconds

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified July 21 14:09 EDT 2024. Contains 374474 sequences. (Running on oeis4.)