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

A348433 a(1) = 1; a(n+1) = 2*a(n) if the digit sum of a(n) is already in the sequence, otherwise a(n+1) = digitsum(a(n)).

Original entry on oeis.org

1, 2, 4, 8, 16, 7, 14, 5, 10, 20, 40, 80, 160, 320, 640, 1280, 11, 22, 44, 88, 176, 352, 704, 1408, 13, 26, 52, 104, 208, 416, 832, 1664, 17, 34, 68, 136, 272, 544, 1088, 2176, 4352, 8704, 19, 38, 76, 152, 304, 608, 1216, 2432, 4864, 9728, 19456, 25, 50, 100, 200
Offset: 1

Views

Author

Rodolfo Kurchan, Oct 18 2021

Keywords

Comments

There are no multiples of 3 in this sequence.
Will all other positive integers appear in this sequence?

Examples

			The sum of the digits of a(4) = 8 is 8, which is already in the sequence, so a(5) = 2*8 = 16.
The sum of the digits of a(5) = 16 is 7, which is not yet in the sequence, so a(6) = 7.
From _Omar E. Pol_, Oct 19 2021: (Start)
Written as an irregular triangle the sequence begins (see A348408):
   1,  2,  4,   8,  16;
   7, 14;
   5, 10, 20,  40,  80, 160,  320,  640, 1280;
  11, 22, 44,  88, 176, 352,  704, 1408;
  13, 26, 52, 104, 208, 416,  832, 1664;
  17, 34, 68, 136, 272, 544, 1088, 2176, 4352, 8704;
  19, 38, 76, 152, 304, 608, 1216, 2432, 4864, 9728, 19456;
... (End)
		

Crossrefs

Programs

  • Mathematica
    seq[len_] := Module[{s = {1}, k, d}, While[Length[s] < len, k = s[[-1]]; If[MemberQ[s, (d = Plus @@ IntegerDigits[k])], AppendTo[s, 2*k], AppendTo[s, d]]]; s]; seq[50] (* Amiram Eldar, Oct 19 2021 *)
  • PARI
    lista(nn) = my(s, v=List([1])); for(n=1, nn, if(setsearch(vecsort(v), s=sumdigits(v[n])), listput(v, 2*v[n]), listput(v, s))); v \\ Jinyuan Wang, Oct 21 2021
    
  • PARI
    See Links section.

Extensions

Definition and examples clarified by N. J. A. Sloane, Oct 24 2021

A348624 a(n) = sum of row n of A348433 expressed as an irregular triangle.

Original entry on oeis.org

31, 21, 2555, 2805, 3315, 17391, 38893, 104857575, 59363, 2097120, 31713, 376809, 117440484, 18790481885, 197132241, 2885681109, 42991575, 4966055899, 13153337295, 3959422917, 120946279055305, 4191888080835, 3729543441416139, 321057395310519, 84662395338675, 294669116243901
Offset: 1

Views

Author

Michael De Vlieger, Oct 25 2021

Keywords

Comments

The binary expansion w of a(n) has an interesting appearance shown by the bitmap in links. We may divide w with length m into 3 parts: the most significant part includes all bits including the last 0 before the middle of the word, m/2, a central run of k 1's that includes all but the last 1 before a 0, and a least significant part that includes the last 1 in the central run of 1s and an assortment of 0's. For example, a(3) = 2555 -> 100.11111.1011, which we may partition as shown by "." so as to preserve the otherwise-leading 0 in the last part. The central run of 1s generally increases in length as n increases.

Examples

			Table showing the first 5 rows of A348433 each having A348408(n) terms, and their sum a(n):
n\k 1  2  3   4   5   6   7    8    9     a(n)   binary(a(n))
--------------------------------------------------------------
1:  1  2  4   8  16                   ->   31 ->        11111
2:  7 14                              ->   21 ->        10101
3:  5 10 20  40  80 160 320  640 1280 -> 2555 -> 100111111011
4: 11 22 44  88 176 352 704 1408      -> 2805 -> 101011110101
5: 13 26 52 104 208 416 832 1664      -> 3315 -> 110011110011
		

Crossrefs

Programs

  • Mathematica
    c[1] = m = q = 1; Most@ Reap[Do[If[IntegerQ[c[#]], Set[n, 2 m], Set[n, #]] &@ Total@ IntegerDigits[m]; If[m > n, Sow[q]; Set[q, n], q += n]; Set[c[n], 1]; m = n, 650]][[-1, -1]]
    (* Extract up to 3961 terms from bitmap: *)
    Block[{s = ImageData[ColorNegate@ Import["https://oeis.org/A348624/a348624_2.png"], "Bit"]}, Array[FromDigits[s[[#]], 2] &, 26]] (* Michael De Vlieger, Oct 26 2021 *)
Showing 1-2 of 2 results.