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.

Previous Showing 11-20 of 24 results. Next

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.

Original entry on oeis.org

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
Offset: 0

Views

Author

N. J. A. Sloane and Reinhard Zumkeller, Oct 15 2013; corrected Oct 20 2013

Keywords

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.

Examples

			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.
		

Crossrefs

Programs

  • 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
  • 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)];

A036228 a(1) = 31; a(n+1) = a(n) + sum of decimal digits of a(n).

Original entry on oeis.org

31, 35, 43, 50, 55, 65, 76, 89, 106, 113, 118, 128, 139, 152, 160, 167, 181, 191, 202, 206, 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, 658
Offset: 1

Views

Author

Miklos SZABO (mike(AT)ludens.elte.hu)

Keywords

Comments

Elements >= 214 can be found in A007618

References

  • D. R. Kaprekar, The Mathematics of the New Self Numbers, Privately Printed, 311 Devlali Camp, Devlali, India, 1963.

Crossrefs

Programs

  • Mathematica
    NestList[#+Total[IntegerDigits[#]]&,31,60] (* Harvey P. Dale, Jan 30 2020 *)

Extensions

Edited by Charles R Greathouse IV, Aug 02 2010

A140131 a(n) = a(n-1) + a(n-2) + digsum(a(n-1)) + digsum(a(n-2)), with a(0)=0 and a(1)=1.

Original entry on oeis.org

0, 1, 2, 6, 16, 35, 66, 121, 203, 333, 550, 902, 1473, 2401, 3896, 6330, 10264, 16619, 26919, 43588, 70562, 114198, 184804, 299051, 483906, 783013, 1266971, 2050038, 3317059, 5367143, 8684259, 14051473, 22735799, 36787341, 59523223, 96310634, 155833920, 252144622
Offset: 0

Views

Author

Keywords

Crossrefs

Programs

  • Maple
    P:=proc(n) local i,t; t:=[0,1]; for i from 1 to n do t:=[op(t),t[-2]+t[-1]+convert(convert(t[-2],base,10),`+`)+convert(convert(t[-1],base,10),`+`)]; od; print(op(t)); end: P(34); # Paolo P. Lava, Jun 25 2024
  • Mathematica
    nxt[{a_,b_}]:=a+b+Total[IntegerDigits[a]]+Total[IntegerDigits[b]]; Transpose[NestList[{Last[#],nxt[#]}&,{0,1},40]][[1]] (* Harvey P. Dale, Oct 31 2011 *)

A230299 Define a sequence b_s by b_s(1)=s, b_s(k+1)=b_s(k)+(sum of digits of b_s(k)); a(n) is the number of steps needed for b_n to reach a term in one of b_0, b_1, b_3 or b_9, or a(n) = -1 if b_n never joins one of these four sequences.

Original entry on oeis.org

0, 0, 0, 0, 0, 52, 0, 11, 0, 0, 51, 50, 0, 49, 10, 0, 0, 48, 0, 9, 50, 0, 49, 0, 0, 47, 48, 0, 0, 8, 0, 49, 46, 0, 47, 48, 0, 45, 0, 0, 7, 46, 7, 47, 6, 0, 45, 44, 6, 0, 46, 0, 5, 5, 0, 45, 44, 0, 43, 4, 5, 4, 0, 0, 4, 44, 4, 43, 3, 0, 0, 42, 0, 3, 3, 4, 43, 0
Offset: 0

Views

Author

Keywords

Comments

We conjecture that a(n) is never -1.

Crossrefs

Programs

  • 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(s) and one of f(1), f(3), f(9) and p is the position where it occurred.
    # If f(s) and all of f(1), f(3), f(9) are disjoint for M terms, returns (-1,-1)
    S1:=convert(f(1),set):
    S3:=convert(f(3),set):
    S9:=convert(f(9),set):
    g:=proc(s) global f,S1,S3,S9; local t1,p,T0,T1,T2;
    T0:=f(s):
    T1:=convert(T0,set);
    if ((s mod 9) = 3) or ((s mod 9) = 6) then   T2:= T1 intersect S3;   t1:=min(T2);   if (t1 = infinity) then RETURN(-1,-1); else     member(t1,T0,'p'); RETURN(t1,p-1); fi;
    elif ((s mod 9) = 0) then   T2:= T1 intersect S9;   t1:=min(T2);   if (t1 = infinity) then RETURN(-1,-1); else     member(t1,T0,'p'); RETURN(t1,p-1); fi;
    else   T2:= T1 intersect S1;   t1:=min(T2);   if (t1 = infinity) then RETURN(-1,-1); else     member(t1,T0,'p'); RETURN(t1,p-1); fi;
    fi;
    end;
    [seq(g(n)[2],n=1..45)];

Extensions

Terms a(46) and beyond from Lars Blomberg, Jan 10 2018

A249043 a(1) = 42; a(n+1) = a(n) + sum of decimal digits of a(n).

Original entry on oeis.org

42, 48, 60, 66, 78, 93, 105, 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, 507, 519, 534, 546, 561, 573, 588, 609, 624, 636
Offset: 1

Views

Author

N. J. A. Sloane, Oct 30 2014

Keywords

References

  • D. R. Kaprekar, The Mathematics of the New Self Numbers, Privately Printed, 311 Devlali Camp, Devlali, India, 1963.

Crossrefs

Programs

  • Haskell
    a249043 n = a249043_list !! (n-1)
    a249043_list = iterate a062028 42
    -- Reinhard Zumkeller, Oct 31 2014

Formula

a(n+1) = A062028(a(n)). - Reinhard Zumkeller, Oct 31 2014

A036227 a(1) = 20; a(n+1) = a(n) + sum of decimal digits of a(n).

Original entry on oeis.org

20, 22, 26, 34, 41, 46, 56, 67, 80, 88, 104, 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, 658
Offset: 1

Views

Author

Miklos SZABO (mike(AT)ludens.elte.hu)

Keywords

Comments

elements >= 109 can be found in A007618.

Crossrefs

Programs

  • Mathematica
    NestList[#+Total[IntegerDigits[#]]&,20,60] (* Harvey P. Dale, May 11 2014 *)

Extensions

Edited by Charles R Greathouse IV, Aug 02 2010

A036233 Inverse Colombian function.

Original entry on oeis.org

1, 1, 3, 1, 5, 3, 7, 1, 9, 5, 5, 3, 5, 7, 3, 1, 5, 9, 7, 20, 3, 20, 1, 3, 5, 20, 9, 1, 7, 3, 31, 5, 3, 20, 31, 9, 5, 1, 3, 7, 20, 42, 31, 7, 9, 20, 5, 42, 1, 31, 3, 7, 53, 9, 31, 20, 3, 5, 7, 42, 53, 1, 9, 64, 31, 42, 20, 53, 3, 1, 5, 9, 7, 64, 75, 31, 1, 42, 5, 20, 9, 53, 7, 3, 64, 86, 75, 20
Offset: 1

Views

Author

Miklos SZABO (mike(AT)ludens.elte.hu)

Keywords

Comments

a(n) is the smallest x with n in the digit summing sequence starting with x.
Contains only self-numbers, see A003052.

Crossrefs

A123171 a(1) = 123, a(n) = sum of digits of all previous terms.

Original entry on oeis.org

123, 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, 507, 519, 534
Offset: 1

Views

Author

Herman Jamke (hermanjamke(AT)fastmail.fm), Oct 02 2006

Keywords

Comments

a(1) = 123 a(2) = 1 + 2 + 3 = 6 a(3) = (1 + 2 + 3) + 6 = 12 a(4) = (1 + 2 + 3) + 6 + (1 + 2) = 15 a(5) = (1 + 2 + 3) + 6 + (1 + 2) + (1 + 5) = 21 a(6) = (1 + 2 + 3) + 6 + (1 + 2) + (1 + 5) + (2 + 1) = 24 a(7) = (1 + 2 + 3) + 6 + (1 + 2) + (1 + 5) + (2 + 1) + (2 + 4) = 30 ...
Essentially the same as A016052. - R. J. Mathar, Jun 18 2008

Crossrefs

Cf. A004207.

Programs

  • Mathematica
    s={123};sum=0;Do[sum=sum+Total[IntegerDigits[s[[-1]]]];AppendTo[s,sum],{n,54}];s (* James C. McMahon, Nov 16 2024 *)
  • PARI
    s=0; a=123; print1(a,","); for(n=1,100,dig=eval(Vec(Str(a)));s=s+sum(i=1,length(dig),dig[i]);print1(s,",");a=s)

Formula

a(n) = a(n-1) + sum of digits of a(n-1), a(1) = 123

A140132 a(n) = Sum_digits{a(n-1)+a(n-2)+Sum_digits[a(n-1)]+Sum_digits[a(n-2)]}, with a(0)=0 and a(1)=1.

Original entry on oeis.org

0, 1, 2, 6, 7, 8, 3, 4, 5, 9, 10, 11, 6, 7, 8, 3, 4, 5, 9, 10, 11, 6, 7, 8, 3, 4, 5, 9, 10, 11, 6, 7, 8, 3, 4, 5, 9, 10, 11, 6, 7, 8, 3, 4, 5, 9, 10, 11, 6, 7, 8, 3, 4, 5, 9, 10, 11, 6, 7, 8, 3, 4, 5, 9, 10, 11, 6, 7, 8, 3, 4, 5, 9, 10, 11, 6, 7, 8, 3, 4, 5, 9, 10, 11, 6, 7, 8, 3, 4, 5, 9, 10, 11, 6, 7
Offset: 0

Views

Author

Keywords

Comments

After the first three terms the sequence is periodic: 6,7,8,3,4,5,9,10,11.

Crossrefs

Programs

  • Maple
    P:=proc(n) local a,i,t; t:=[0,1]; for i from 1 to n do
    a:=t[-2]+t[-1]+convert(convert(t[-2],base,10),`+`)+convert(convert(t[-1],base,10),`+`);
    t:=[op(t),convert(convert(a,base,10),`+`)]; od; print(op(t)); end: P(93); # Paolo P. Lava, Jun 25 2024

A151942 Table of Self / Colombian numbers and their descendents.

Original entry on oeis.org

1, 2, 3, 4, 6, 5, 8, 12, 10, 7, 16, 15, 11, 14, 9, 23, 21, 13, 19, 18, 20, 28, 24, 17, 29, 27, 22, 31, 38, 30, 25, 40, 36, 26, 35, 42, 49, 33, 32, 44, 45, 34, 43, 48, 53, 62, 39, 37, 52, 54, 41, 50, 60, 61, 64, 70, 51, 47, 59, 63, 46, 55, 66, 68, 74, 75, 77, 57, 58, 73, 72, 56
Offset: 1

Views

Author

Carl R. White, Jul 13 2009

Keywords

Comments

Initially resembles a permutation of the integers, but this is not the case. 101 is the first number to appear twice, descending from both 91 and 100: 91 + 9+1 = 100 + 1+0+0 = 101

Crossrefs

First column of table is the Self numbers: A003052; First through eighth rows are A004207, A016052, A007618, A006507, A016096, A036227, A036228 respectively.

Formula

T(r,0) are those numbers not of form n + sum of digits of n (Self numbers)
T(r,c) = T(r,c-1) + sum of digits of T(r,c-1)
Previous Showing 11-20 of 24 results. Next