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 51-60 of 66 results. Next

A248078 a(1) = 1; a(n+1) = a(n) + product of digits of a(n) + sum of digits of a(n).

Original entry on oeis.org

1, 3, 9, 27, 50, 55, 90, 99, 198, 288, 434, 493, 617, 673, 815, 869, 1324, 1358, 1495, 1694, 1930, 1943, 2068, 2084, 2098, 2117, 2142, 2167, 2267, 2452, 2545, 2761, 2861, 2974, 3500, 3508, 3524, 3658, 4400, 4408, 4424, 4566, 5307, 5322, 5394, 5955, 7104, 7116
Offset: 1

Views

Author

Gil Broussard, Sep 30 2014

Keywords

Comments

Unlike A063108, this sequence includes in its formula the digit 0 in the product of digits of a(n).

Examples

			Given a(5)=50, then a(6)=50+(5+0)+(5*0)=55.
		

Crossrefs

Programs

  • Maple
    f:= proc(x) local L;
      L:= convert(x,base,10);
      x + convert(L,`+`)+convert(L,`*`)
    end proc:
    A[1]:= 1:
    for n from 2 to 100 do A[n]:= f(A[n-1]) od:
    seq(A[i],i=1..100); # Robert Israel, Jun 25 2019
  • Mathematica
    NestList[#+Total[IntegerDigits[#]]+Times@@IntegerDigits[#]&,1,50] (* Harvey P. Dale, Sep 11 2019 *)
  • PARI
    lista(nn) = {prev = 1; print1(prev, ", "); for (n=1, nn, d = digits(prev); prev += sumdigits(prev) + prod(k=1, #d, d[k]); print1(prev, ", "););} \\ Michel Marcus, Oct 01 2014

A272233 Number of steps before n1(i) = n2(i) when n1(i) = n1(i-1) + digsum(n2(i-1)), n2(i) = n2(i-1) + digsum(n1(i-1)) and n1(1) = 10^(n-1), n2(1) = 0.

Original entry on oeis.org

1, 12, 57, 22820, 754504
Offset: 0

Views

Author

Anthony Sand, Apr 23 2016

Keywords

Comments

The sequence takes two different numbers, n1 and n2, and simultaneously adds the digit sum of n1 to n2 and the digit sum of n2 to n1. This process continues until n1 = n2. The two numbers are initialized with n1 = 10^(n-1) and n2 = 0.
a(5) > 10^12. - Lars Blomberg, Jul 19 2017

Examples

			10 > 0, 10 > 1, 11 > 2, 13 > 4, 17 > 8, 25 > 16, 32 > 23, 37 > 28, 47 > 38, 58 > 49, 71 > 62, 79 > 70, 86 = 86
		

Crossrefs

Programs

  • PARI
    {digsum(num) = d=digits(num,b); return(sum(i=1,#d,d[i]));} {doubledigsum() = b=10; nmx=5; for(n=1,nmx, n1=b^(a-1); n2=0; c=0; until(n1==n2, s1=digsum(n1); s2=digsum(n2); n1+=s2; n2+=s1; c++); print1(c,", "); ); }

Formula

n1(i) = n1(i-1) + digsum(n2(i-1)), n2(i) = n2(i-1) + digsum(n1(i-1))

A272235 In base 2, number of steps before n1(i) = n2(i) when n1(i) = n1(i-1) + digsum(n2(i-1)), n2(i) = n2(i-1) + digsum(n1(i-1)) and n1(1) = 2^(n-1), n2(1) = 0.

Original entry on oeis.org

1, 3, 5, 8, 1204, 1205, 1199, 1191, 19536395, 19536233, 19535912, 19535673, 19519159
Offset: 0

Views

Author

Anthony Sand, Apr 23 2016

Keywords

Comments

The sequence takes two different binary numbers, n1 and n2, and simultaneously adds the digit sum of n1 to n2 and the digit sum of n2 to n1. This process continues until n1 = n2. The two numbers are initialized with n1 = 2^(n-1) and n2 = 0.

Examples

			In base 2: 1000 > 0, 1000 > 1, 1001 > 10, 1010 > 100, 1011 > 110, 11111 > 1100, 10001 > 10000, 10010 = 10010
In base 10: 8 > 0, 8 > 1, 9 > 2, 10 > 4, 11 > 6, 13 > 9, 15 > 12, 17 > 16, 18 = 18
		

Crossrefs

Programs

  • PARI
    digsum(num) = d=digits(num,2); return(sum(i=1,#d,d[i]));
    doubledigsum() = b=2; nnx=5; for(n=1,amx, n1=b^(n-1); n2=0; c=0; until(n1==n2, s1=digsum(n1); s2=digsum(n2); n1+=s2; n2+=s1; c++); print1(c,", "); );

Formula

n1(i) = n1(i-1) + digsum(n2(i-1),base=2), n2(i) = n2(i-1) + digsum(n1(i-1),base=2)

A289979 Define two sequences n1(i) and n2(i) by the recurrences n1(i) = n1(i-1) + digsum(n2(i-1)), n2(i) = n2(i-1) + digsum(n1(i-1)), with initial values n1(1) = n and n2(1) = 0. Then a(n) is the smallest m such that n1(i) = n2(i) = m for some i, or -1 if no such m exists.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 86, 86, 42, 86, 20, 42, 53, 86, 108, 20, 110, 222, 110, 31, 222, 310, 110, 288, 31, 97, 75, 154, 64, 75, 692, 154, 468, 64, 176, 75, 389, 367, 132, 187, 389, 648, 367, 209, 132, 211, 1772, 411, 446, 1715, 828, 1772, 7150, 411, 413
Offset: 1

Views

Author

Anthony Sand, Jul 17 2017

Keywords

Comments

The function is like a chase that ends when n1(i) = n2(i). For example, when n = 14:
n1(1) = 14, n2(1) = 0
n1(2) = 14 = 14 + digsum(0), n2(2) = 5 = 0 + digsum(14)
n1(3) = 19 = 14 + digsum(5), n2(3) = 10 = 5 + digsum(14)
n1(4) = 20 = 19 + digsum(10), n2(4) = 20 = 10 + digsum(19)
Because n1 = n2 = 20, the chase ends and a(14) = 20. When n = 81, a(81) > 10^8 and the chase may never end. In other bases, some different number first produces a prolonged chase with no result. E.g., in base 9, the number is 64 = 71 (b9); in base 12, the number is 110 = 92 (b12). In base 2, when n = 178, n1 = n2 = 6181 and when n = 179, n1 = n2 = 267684506.
If a(81) exists, it is larger than 5*10^14. - Giovanni Resta, Jul 21 2017

Examples

			n1(1) = 12, n2(1) = 0
n1(2) = 12 = 12 + digsum(0), n2(2) = 3 = 0 + digsum(12)
n1(3) = 15 = 12 + digsum(3), n2(3) = 6 = 3 + digsum(12)
n1(4) = 21 = 15 + digsum(6), n2(4) = 12 = 6 + digsum(15)
n1(5) = 24 = 21 + 3, n2(5) = 15 = 12 + 3
n1(6) = 30 = 24 + 6, n2(6) = 21 = 15 + 6
n1(7) = 33 = 30 + 3, n2(7) = 24 = 21 + 3
n1(8) = 39 = 33 + 6, n2(8) = 30 = 24 + 6
n1(9) = 42 = 39 + 3, n2(9) = 42 = 30 + 12
		

Crossrefs

Cf. A004207.

Programs

  • Mathematica
    Table[NestWhileList[{#1 + Total@ IntegerDigits[#2], #2 + Total@ IntegerDigits[#1]} & @@ # &, {n, 0}, UnsameQ @@ # &, 1, 10^4][[-1, -1]], {n, 80}] (* Michael De Vlieger, Jul 17 2017 *)

Formula

n1(1) = n, n2(1) = 0, then n1(i) = n1(i-1) + digsum(n2(i-1)), n2(i) = n2(i-1) + digsum(n1(i-1)) until n1(i) = n2(i).

A329068 a(1) = 1; thereafter if the sum of digits of all previous terms up to a(n) is even then a(n+1) = (sum of digits of all previous terms)/2, otherwise a(n+1) = (sum of digits of all previous terms)*3 + 1.

Original entry on oeis.org

1, 4, 16, 6, 9, 82, 112, 124, 24, 27, 190, 220, 232, 42, 45, 298, 59, 66, 72, 460, 490, 88, 96, 622, 652, 115, 712, 742, 130, 132, 135, 838, 149, 156, 162, 1000, 167, 174, 180, 1108, 1138, 196, 204, 207, 1270, 1300, 1312, 222, 225, 1378, 239, 246, 252, 1540, 1570, 268, 276
Offset: 1

Views

Author

Bence BernĂ¡th, Nov 03 2019

Keywords

Crossrefs

Programs

  • MATLAB
    clear all;
    length_seq=10000;
    sequence(1)=1;
    seq_for_digits(1)=sequence(1);
    for i1=1:1:length_seq
       if  0==mod(sum(seq_for_digits),2)
            sequence(i1+1)=sum(seq_for_digits)/2;
       else
         sequence(i1+1)=sum(seq_for_digits)*3+1;
       end
         append=num2str(sequence(i1+1))-'0';
         seq_for_digits=[seq_for_digits append];
    end
    result=transpose(sequence);
    
  • PARI
    lista(nn) = {va = vector(nn); va[1] = 1; sd = sumdigits(va[1]); for (n=2, nn, if (sd % 2, va[n] = 3*sd+1, va[n] = sd/2); sd += sumdigits(va[n]);); va;} \\ Michel Marcus, Nov 04 2019
    
  • Python
    from itertools import islice
    def agen(): # generator of terms
        sd, an = 0, 1
        while True:
            yield an
            sd += sum(map(int, str(an)))
            an = 3*sd+1 if sd&1 else sd//2
    print(list(islice(agen(), 60))) # Michael S. Branicky, Nov 12 2022

A341817 If a(n) is odd, add to a(n) its odd digits and iterate; if a(n) is even, add to a(n) its even digits and iterate; if an iteration reproduces a term already in the sequence, don't do this iteration and extend the sequence with the smallest integer not yet present in the sequence.

Original entry on oeis.org

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

Views

Author

Eric Angelini and Carole Dubois, Feb 20 2021

Keywords

Comments

This sequence is, by definition, a permutation of the positive integers.

Examples

			a(1) = 1, odd, a(2) is thus 1 + 1 = 2;
a(2) = 2, even, thus a(3) = 2 + 2 = 4;
a(3) = 4, even, thus a(4) = 4 + 4 = 8;
a(4) = 8, even, thus a(5) = 8 + 8 = 16;
a(5) = 16, even, thus a(6) = 16 + 6 = 22;
a(6) = 22, even, thus a(7) = 22 + 2 + 2 = 26;
...
a(13) = 70, even, thus a(14) = 70 + 0 = 70 (already in the sequence, thus a(14) = 3 instead, the smallest integer not yet present in the sequence);
a(14) = 3, odd, thus a(15) = 3 + 3 = 6;
a(15)  = 6, even, thus a(16) = 6 + 6 = 12;
a(16) = 12, even, thus a(17) =  12 + 2 = 14;
a(17) = 14, even, thus a(18) = 14 + 4 = 18;
a(18) =  18, even, thus a(19) = 18 + 6 = 26 (already in the sequence, thus a(19) = 5 instead, the smallest integer not yet present in the sequence);
a(19) = 5, odd, thus a(20) = 5 + 5 = 10; etc.
		

Crossrefs

Cf. A004207 (sum of digits of all previous terms).

A036230 a(n+1) = a(n) + sum of digits of a(n) starting with 110.

Original entry on oeis.org

110, 112, 116, 124, 131, 136, 146, 157, 170, 178, 194, 208, 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, 587, 607, 620, 628, 644, 658, 677, 697, 719
Offset: 1

Views

Author

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

Keywords

Comments

Elements >= 218 can be found in A004207.

Crossrefs

Programs

  • Mathematica
    NestList[#+Total[IntegerDigits[#]]&,110,50] (* Harvey P. Dale, Oct 01 2017 *)

A036231 a(n+1) = a(n) + sum of digits of a(n) starting with 121.

Original entry on oeis.org

121, 125, 133, 140, 145, 155, 166, 179, 196, 212, 217, 227, 238, 251, 259, 275, 289, 308, 319, 332, 340, 347, 361, 371, 382, 395, 412, 419, 433, 443, 454, 467, 484, 500, 505, 515, 526, 539, 556, 572, 586, 605, 616, 629, 646, 662, 676, 695, 715, 728, 745
Offset: 1

Views

Author

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

Keywords

Comments

Elements >= 1003 can be found in A004207.

Crossrefs

A036232 a(n+1) = a(n) + sum of digits of a(n) starting with 211.

Original entry on oeis.org

211, 215, 223, 230, 235, 245, 256, 269, 286, 302, 307, 317, 328, 341, 349, 365, 379, 398, 418, 431, 439, 455, 469, 488, 508, 521, 529, 545, 559, 578, 598, 620, 628, 644, 658, 677, 697, 719, 736, 752, 766, 785, 805, 818, 835, 851, 865, 884, 904, 917, 934
Offset: 1

Views

Author

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

Keywords

Comments

Elements >= 317 can be found in A007618.

Crossrefs

Programs

  • Mathematica
    NestList[#+Total[IntegerDigits[#]]&,211,50] (* Harvey P. Dale, Jul 16 2020 *)

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

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 10, 11, 13, 17, 25, 22, 25, 30, 29, 32, 30, 29, 33, 36, 34, 36, 42, 37, 41, 37, 40, 35, 37, 37, 42, 38, 45, 46, 46, 46, 50, 44, 43, 40, 34, 31, 30, 25, 25, 28, 31, 31, 32, 30, 26, 24, 26, 30, 28, 35, 35, 37, 39, 48, 50, 47, 50, 45, 42, 36, 40, 33
Offset: 1

Views

Author

Alexandre Wajnberg, Dec 11 2005

Keywords

Comments

Variation on Angelini's A112395. The sequence cycles at a(28)=42 and the loop has 312 terms. Computed by Gilles Sadowski.

Examples

			a(28)=42 because 2+9 + 3+3 + 3+6 + 3+4 + 3+6 = 42
		

Crossrefs

Previous Showing 51-60 of 66 results. Next