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 31-40 of 66 results. Next

A230287 First differences of A016052/3 (= A230286).

Original entry on oeis.org

1, 2, 1, 2, 1, 2, 1, 2, 4, 2, 4, 5, 4, 5, 1, 2, 1, 2, 4, 2, 4, 5, 4, 5, 1, 2, 1, 2, 4, 2, 4, 5, 4, 5, 4, 2, 4, 2, 4, 5, 4, 5, 4, 5, 4, 2, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 7, 5, 4, 5, 4, 5, 7, 8, 4, 5, 4, 5, 7, 8, 4, 5, 7, 5, 7, 5, 4, 5, 7, 8, 7, 2, 1, 2, 4, 2, 4, 5, 4, 5, 1, 2, 1, 2, 4, 2, 4, 5, 4, 5, 4
Offset: 1

Views

Author

Keywords

Comments

This sequence captures the essence of A016052.
Essentially the same as A084228/3.

Crossrefs

Programs

  • Haskell
    a230287 n = a230287_list !! (n-1)
    a230287_list = zipWith (-) (tail a230286_list) a230286_list

A230297 a(n) = A010062(n) written in binary: a(n+1) = a(n) + hammingweight(a(n)) in binary.

Original entry on oeis.org

1, 10, 11, 101, 111, 1010, 1100, 1110, 10001, 10011, 10110, 11001, 11100, 11111, 100100, 100110, 101001, 101100, 101111, 110100, 110111, 111100, 1000000, 1000001, 1000011, 1000110, 1001001, 1001100, 1001111, 1010100, 1010111, 1011100, 1100000, 1100010, 1100101, 1101001, 1101101, 1110010, 1110110, 1111011, 10000001, 10000011
Offset: 0

Views

Author

N. J. A. Sloane, Oct 17 2013

Keywords

Comments

Is there any way to tell by looking at a binary number whether or not it is a term of this sequence?

Crossrefs

Cf. A010062.
Essentially the same as A157845.
Cf. A004207 (base-10 analog); A007088 (n in binary), A010062 (this written in base 10), A000120 (Hammingweight), A092391 (A000120(n) + n), A028897 (convert binary to decimal).

Programs

  • Mathematica
    s[0] = 1; s[n_] := s[n] = s[n-1] + DigitCount[s[n-1], 2, 1]; Table[FromDigits[IntegerDigits[s[n], 2]], {n, 0, 50}] (* Amiram Eldar, Jul 28 2023 *)
  • PARI
    (A230297(n)=A007088(A010062(n))); A230297_vec(N)={vector(N,i, if(i>1, A007088(N+=hammingweight(N)), N=1))} \\ M. F. Hasler, Nov 18 2019

Formula

a(n) = A157845(n+1) = A007088(A010062(n)) = A007088(A092391(A028897(a(n-1)))). - M. F. Hasler, Nov 18 2019

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

A157845 a(0) = 1, a(n) = sum of binary digits of all prior terms, expressed in binary.

Original entry on oeis.org

1, 1, 10, 11, 101, 111, 1010, 1100, 1110, 10001, 10011, 10110, 11001, 11100, 11111, 100100, 100110, 101001, 101100, 101111, 110100, 110111, 111100, 1000000, 1000001, 1000011, 1000110, 1001001, 1001100, 1001111, 1010100, 1010111, 1011100, 1100000, 1100010
Offset: 0

Views

Author

Oliver K. Seet, Mar 07 2009

Keywords

Comments

Equals A230297 = A010062 converted from decimal to binary, prefixed by another initial 1. - M. F. Hasler, Nov 18 2019

Crossrefs

Cf. A004207 (base-10 analog); A007088 (n in binary), A010062 (this written in base 10), A000120 (Hammingweight), A092391 (A000120(n) + n), A028897 (convert binary to decimal).

Programs

  • Maple
    b:= proc(n) option remember; `if`(n<2, 1, b(n-1)+
          add(i, i=convert(a(n-1), base, 10)))
        end:
    a:= n-> convert(b(n), binary):
    seq(a(n), n=0..44);  # Alois P. Heinz, Nov 18 2019
  • Mathematica
    s[0] = s[1] = 1; s[n_] := s[n] = s[n-1] + DigitCount[s[n-1], 2, 1]; Table[FromDigits[IntegerDigits[s[n], 2]], {n, 0, 50}] (* Amiram Eldar, Jul 28 2023 *)
  • PARI
    lista(nn) = {my(s = 1); my(t = 1); print1(t, ", "); for (i=1, nn, sb = binary(s); t = subst(Pol(sb), x, 10); print1(t, ", "); s += hammingweight(sb););}
    
  • PARI
    apply( A157845(n)=fromdigits(binary(A010062(n-!!n))), [0..40]) \\ M. F. Hasler, Nov 18 2019

Formula

a(n) = A230297(n-1) = A007088(A010062(n-1)) = A007088(A092391(A028897(a(n-1)))) for n > 0. - M. F. Hasler, Nov 18 2019

Extensions

a(11) corrected and extended by R. J. Mathar, Mar 12 2009
More terms from Michel Marcus, Apr 19 2014

A112435 Next term is the sum of the last 10 digits in the sequence, beginning with a(10) = 4.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 8, 16, 23, 28, 38, 45, 42, 41, 41, 36, 34, 32, 31, 30, 28, 29, 33, 34, 37, 44, 42, 37, 41, 39, 41, 38, 43, 40, 39, 39, 46, 45, 47, 54, 51, 45, 44, 43, 39, 42, 42, 39, 43, 43, 38, 43, 44, 40, 37, 40, 33, 32, 29, 36, 35, 39, 45, 49, 51, 48, 52, 47
Offset: 1

Views

Author

Alexandre Wajnberg, Dec 11 2005

Keywords

Comments

Variation on Angelini's A112395. The sequence cycles at a(16)=38 and the loop has 312 terms. It is exactly the same loop as in A112433 "Next term is the sum of the last 10 digits in the sequence, beginning with a(10) = 2" and the first term of this 4-loop is the first term of that 2-loop . Computed by Gilles Sadowski.

Examples

			a(16)=38 because 4 + 4 + 8 + 1+6 +2+3 + 2+8 = 38
		

Crossrefs

Programs

  • Mathematica
    nxt[{t_,a_}]:={Take[Join[t,IntegerDigits[Total[t]]],-10],Total[t]}; Join[ {0,0,0,0,0,0,0,0,0},NestList[nxt,{{0,0,0,0,0,0,0,0,0,4},4},80][[All,2]]] (* Harvey P. Dale, Jun 22 2019 *)

A229527 Start with 1, skip (sum of digits of n) numbers, accept next number.

Original entry on oeis.org

1, 3, 7, 15, 22, 27, 37, 48, 61, 69, 85, 99, 118, 129, 142, 150, 157, 171, 181, 192, 205, 213, 220, 225, 235, 246, 259, 276, 292, 306, 316, 327, 340, 348, 364, 378, 397, 417, 430, 438, 454, 468, 487, 507, 520, 528, 544, 558, 577, 597
Offset: 1

Views

Author

Dave Durgin, Sep 25 2013

Keywords

Examples

			a(1)=1, a(2)=1+1+1=3, a(3)=3+3+1=7, a(4)=7+7+1=15, a(5)=15+1+5+1=22, a(6)=22+2+2+1=27, ...
		

Crossrefs

Programs

  • Mathematica
    a[n_] := a[n] = a[n - 1] + 1 + Plus @@ IntegerDigits@a[n - 1]; a[1] = 1; Array[a, 50] (* Robert G. Wilson v, Aug 01 2018 *)
  • Python
    from itertools import islice
    def A229527_gen(): # generator of terms
        a = 1
        while True:
            yield a
            a += sum(map(int,str(a)))+1
    A229527_list = list(islice(A229527_gen(),40)) # Chai Wah Wu, Aug 09 2025

Formula

a(n+1) = a(n) + (sum of digits of a(n)) + 1.

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

A243259 Numbers n such that n appears in the sequence x(i) = x(i-1) +/- digitsum(x(i-1)), where even digitsums are added, odd digitsums are subtracted and x(0) = n.

Original entry on oeis.org

99, 108, 117, 198, 207, 216, 297, 306, 315, 396, 405, 414, 495, 504, 513, 594, 603, 612, 693, 702, 711, 792, 801, 810, 972, 990, 999, 1008, 1098, 1107, 1116, 1197, 1206, 1215, 1296, 1305, 1314, 1395, 1404, 1413, 1494, 1503, 1512, 1593, 1602, 1611, 1692, 1701
Offset: 1

Views

Author

Anthony Sand, Jun 02 2014

Keywords

Comments

The sequence begins with x(0) = n and continues by adding or subtracting the digitsum. When the digitsum(x(i-1)) is even, x(i) = x(i-1) + digitsum(x(i-1)), otherwise x(i) = x(i-1) - digitsum(x(i-1)).

Examples

			digitsum(99) = 18, 18 is even, so 99 + 18 = 117. digitsum(117) = 9, 9 is odd, so 177 - 9 = 108. 108 - 9 = 99, hence 99 belongs to sequence.
108 - 9 = 99, 99 + 18 = 117, 117 - 9 = 108, hence 108 is in the sequence.
117 - 9 = 108. 108 - 9 = 99. 99 + 18 = 117.
198 + 18 = 216. 216 - 9 = 207. 207 - 9 = 198.
		

Crossrefs

Formula

x(i) = x(i-1) + digitsum(x(i-1)) * (1 - (digitsum(x(i-1)) mod 2) * 2).

A243260 Numbers n such that n appears in the sequence x(i) = x(i-1) +/- digitsum(x(i-1)), where even digit sums are subtracted, odd digit sums are added and x(0) = n.

Original entry on oeis.org

81, 90, 99, 171, 180, 189, 261, 270, 279, 351, 360, 369, 441, 450, 459, 531, 540, 549, 621, 630, 639, 711, 720, 729, 801, 810, 819, 1071, 1080, 1089, 1161, 1170, 1179, 1251, 1260, 1269, 1341, 1350, 1359, 1431, 1440, 1449, 1521, 1530, 1539, 1611, 1620, 1629
Offset: 1

Views

Author

Anthony Sand, Jun 02 2014

Keywords

Comments

The auxiliary sequence begins with x(0) = n and continues by adding or subtracting the digit sum. When the digitsum(x(i-1)) is even, x(i) = x(i-1) - digitsum(x(i-1)), otherwise x(i) = x(i-1) + digitsum(x(i-1)).

Examples

			digitsum(81) = 9, 9 is odd, so 81 + 9 = 90. 90 + 9 = 99. digitsum(99) = 18, 18 is even, so 99 - 18 = 81, so 81 is in the list.
90 + 9 = 99. 99 - 18 = 81. 81 + 9 = 90.
99 - 18 = 81. 81 + 9 = 90. 90 + 9 = 99.
171 + 9 = 180. 180 + 9 = 189. 189 - 18 = 171.
180 + 9 = 189. 189 - 18 = 171. 171 + 9 = 180.
Starting with n=81, we have 81+9(odd)=90, 90+9(odd)=99, 99-18(even)=81 for the auxiliary x(i) sequence; so 81 is in the main sequence; starting with n=90 or 99 will lead to the same cycle loop, so 90, 99 are also in this sequence.
		

Crossrefs

Formula

x(i) = x(i-1) + digitsum(x(i-1)) * -(1 - (digitsum(x(i-1)) mod 2) * 2).

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
Previous Showing 31-40 of 66 results. Next