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.

User: Anthony Sand

Anthony Sand's wiki page.

Anthony Sand has authored 49 sequences. Here are the ten most recent ones:

A327421 In a Kolakoski n-chain, point at which term of penultimate sequence seq(n-1) differs from term of final sequence seq(n) in chain, when terms of seq(i) are run-lengths of seq(i+1) and the chain contains n sequences.

Original entry on oeis.org

0, 1, 2, 3, 5, 8, 12, 19, 29, 44, 66, 100, 151, 227, 341, 512, 769, 1154, 1729, 2591, 3886, 5827, 8743, 13117, 19675, 29515, 44281, 66432, 99668, 149532, 224307, 336451, 504649, 756962, 1135451, 1703198, 2554847, 3832293, 5748475, 8622647
Offset: 1

Author

Anthony Sand, Nov 29 2019

Keywords

Comments

The terms of the Kolakoski sequence, A000002, are the run-lengths of the same sequence. The terms of the sequence never differ from themselves and a(1) is therefore assigned the value 0. In a Kolakoski n-chain consisting of n >= 2 sequences, the terms of seq(i) are the run-lengths of seq(i+1), with the final sequence, seq(n), in the chain being the run-lengths of seq(1). The sequence above, a(n), records the term at which seq(n-1) differs from seq(n) in a chain of n sequences that use the alphabets {2,1} for seq(1) and {1,2} for seq(2..n). For example, in the Kolakoski 2-chain, A025142 and A025143, the sequences are:
seq(1) = 2,1,2,2,1,2,1,1,2,2,1,2,2,1,1,2,1,1,2,1,2,2,1,1,2,1,1,2,2,1,2,1,1,... (A025143)
seq(2) = 1,1,2,1,1,2,2,1,2,2,1,2,1,1,2,2,1,2,2,1,1,2,1,2,2,1,2,1,1,2,1,1,2,... (A025142)
The penultimate sequence, seq(n-1 = 1), differs from the final sequence, seq(n = 2), at the 1st term and therefore a(2) = 1. In this Kolakoski 3-chain, seq(n-1) differs from seq(n) at the 2nd term and a(3) = 2:
seq(1) = 2,1,1,2,1,2,2,1,2,1,1,2,2,1,2,2,1,1,2,1,2,2,1,2,2,1,1,2,1,1,2,1,2,...
seq(2) = 1,1,2,1,2,2,1,2,2,1,1,2,1,1,2,1,2,2,1,1,2,1,1,2,2,1,2,1,1,2,1,1,2,...
seq(3) = 1,2,1,1,2,1,1,2,2,1,2,2,1,1,2,1,2,2,1,2,1,1,2,1,1,2,2,1,2,1,1,2,1,...
Conjectures: 1) In a Kolakoski n-chain of the form given, as n -> infinity, seq(n) converges on the Kolakoski sequence, A000002, whose terms always match its own run-lengths, while seq(1) converges on the anti-Kolakoski sequence, A049705, whose terms never match its own run-lengths. 2) As i -> infinity, a(i) / a(i+1) converges on 2/3.

Examples

			In this Kolakoski 4-chain, seq(n-1) differs from seq(n) at the 3rd term and a(4) = 3:
seq(1) = 2,1,1,2,2,1,2,2,1,2,1,1,2,1,1,2,2,1,2,1,1,2,1,2,2,1,2,2,1,1,2,1,...
seq(2) = 1,1,2,1,2,2,1,1,2,1,1,2,2,1,2,2,1,2,1,1,2,1,2,2,1,1,2,1,1,2,1,2,...
seq(3) = 1,2,1,1,2,1,1,2,2,1,2,1,1,2,1,2,2,1,1,2,1,1,2,2,1,2,2,1,2,1,1,2,...
seq(4) = 1,2,2,1,2,1,1,2,1,2,2,1,1,2,1,1,2,1,2,2,1,2,2,1,1,2,1,2,2,1,2,1,...
In this Kolakoski 5-chain, seq(n-1) differs from seq(n) at the 5th term and a(5) = 5:
seq(1) = 2,1,1,2,2,1,2,1,1,2,1,2,2,1,2,2,1,1,2,1,1,2,2,1,2,1,1,2,1,1,2,2,1,...
seq(2) = 1,1,2,1,2,2,1,1,2,1,1,2,1,2,2,1,2,2,1,1,2,1,1,2,2,1,2,1,1,2,1,2,2,...
seq(3) = 1,2,1,1,2,1,1,2,2,1,2,1,1,2,1,2,2,1,2,2,1,1,2,1,1,2,2,1,2,1,1,2,1,...
seq(4) = 1,2,2,1,2,1,1,2,1,2,2,1,1,2,1,1,2,1,2,2,1,2,2,1,1,2,1,1,2,2,1,2,1,...
seq(5) = 1,2,2,1,1,2,1,1,2,1,2,2,1,2,2,1,1,2,1,2,2,1,2,1,1,2,1,1,2,2,1,2,2,...
In this Kolakoski 8-chain, seq(n-1) differs from seq(n) at the 19th term and a(8) = 19:
seq(1) = 2,1,1,2,2,1,2,1,1,2,1,1,2,2,1,2,2,1,1,2,1,2,2,1,2,1,1,2,2,1,2,2,1,...
seq(2) = 1,1,2,1,2,2,1,1,2,1,1,2,1,2,2,1,2,1,1,2,2,1,2,2,1,1,2,1,2,2,1,2,2,...
[...]
seq(7) = 1,2,2,1,1,2,1,2,2,1,2,2,1,1,2,1,1,2,1,2,2,1,2,1,1,2,2,1,2,2,1,1,2,...
seq(8) = 1,2,2,1,1,2,1,2,2,1,2,2,1,1,2,1,1,2,2,1,2,1,1,2,1,2,2,1,2,2,1,1,2,...
		

Crossrefs

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

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).

A288725 Third sequence of a Kolakoski 3-Ouroboros, i.e., sequence of 1s, 2s and 3s that is third in a chain of three distinct sequences where successive run-length encodings produce seq(1) -> seq(2) -> seq(3) -> seq(1).

Original entry on oeis.org

3, 1, 2, 2, 3, 3, 1, 1, 1, 2, 2, 2, 3, 1, 2, 3, 3, 1, 1, 1, 2, 3, 1, 1, 2, 2, 3, 3, 3, 1, 1, 1, 2, 2, 2, 3, 1, 2, 3, 3, 1, 1, 2, 2, 3, 3, 3, 1, 2, 2, 3, 3, 3, 1, 1, 1, 2, 3, 1, 2, 2, 3, 3, 3, 1, 1, 1, 2, 3, 1, 1, 2, 2, 3, 3, 1, 1, 1, 2, 2, 2, 3, 3, 3, 1, 2, 2
Offset: 1

Author

Anthony Sand, Jun 14 2017

Keywords

Comments

See comments at A288723.

Examples

			Write down the run-lengths of the sequence A288723, or the lengths of the runs of 1s, 2s and 3s. This yields a second and different sequence of 1s, 2s and 3s, A288724. The run-lengths of this second sequence yield a third and different sequence, A288725 (as above). The run-lengths of this third sequence yield the original sequence. For example, bracket the runs of distinct integers, then replace the original digits with the run-lengths to create the second sequence:
(1,1), (2,2), (3,3), (1,1,1), (2), (3), (1,1), (2,2), (3,3,3), (1,1,1), (2,2,2), (3), (1), (2), (3,3), (1,1,1), (2), (3,3), (1,1), (2,2,2), ... -> 2, 2, 2, 3, 1, 1, 2, 2, 3, 3, 3, 1, 1, 1, 2, 3, 1, 2, 2, 3, ...
Apply the same process to the second sequence and the third sequence appears:
(2,2,2), (3), (1,1), (2,2), (3,3,3), (1,1,1), (2), (3), (1), (2,2), (3,3), (1,1), (2,2,2), (3), (1,1), (2,2,2), (3,3,3), (1), (2), (3), ... -> 3, 1, 2, 2, 3, 3, 1, 1, 1, 2, 2, 2, 3, 1, 2, 3, 3, 1, 1, 1, ...
Apply the same process to the third sequence and the original sequence reappears:
(3), (1), (2,2), (3,3), (1,1,1), (2,2,2), (3), (1), (2), (3,3), (1,1,1), (2), (3), (1,1), (2,2), (3,3,3), (1,1,1), (2,2,2), (3), (1), ... -> 1, 1, 2, 2, 3, 3, 1, 1, 1, 2, 3, 1, 1, 2, 2, 3, 3, 3, 1, 1, ...
		

Crossrefs

Cf. A000002, A025142, A025143. A288723 and A288724 are the first and second sequences in this 3-Ouroboros.

A288724 Second sequence of a Kolakoski 3-Ouroboros, i.e., sequence of 1s, 2s and 3s that is second in a chain of three distinct sequences where successive run-length encodings produce seq(1) -> seq(2) -> seq(3) -> seq(1).

Original entry on oeis.org

2, 2, 2, 3, 1, 1, 2, 2, 3, 3, 3, 1, 1, 1, 2, 3, 1, 2, 2, 3, 3, 1, 1, 2, 2, 2, 3, 1, 1, 2, 2, 2, 3, 3, 3, 1, 2, 3, 1, 1, 2, 2, 2, 3, 1, 2, 2, 3, 3, 1, 1, 1, 2, 2, 2, 3, 3, 3, 1, 2, 3, 1, 1, 2, 2, 3, 3, 1, 1, 1, 2, 3, 3, 1, 1, 1, 2, 2, 2, 3, 1, 2, 2, 3, 3, 1, 1
Offset: 1

Author

Anthony Sand, Jun 14 2017

Keywords

Comments

See comments at A288723.

Examples

			Write down the run-lengths of the sequence A288723, or the lengths of the runs of 1s, 2s and 3s. This yields a second and different sequence of 1s, 2s and 3s, A288724 (as above). The run-lengths of this second sequence yield a third and different sequence, A288725. The run-lengths of this third sequence yield the original sequence. For example, bracket the runs of distinct integers, then replace the original digits with the run-lengths to create the second sequence:
(1,1), (2,2), (3,3), (1,1,1), (2), (3), (1,1), (2,2), (3,3,3), (1,1,1), (2,2,2), (3), (1), (2), (3,3), (1,1,1), (2), (3,3), (1,1), (2,2,2), ... -> 2, 2, 2, 3, 1, 1, 2, 2, 3, 3, 3, 1, 1, 1, 2, 3, 1, 2, 2, 3, ...
Apply the same process to the second sequence and the third sequence appears:
(2,2,2), (3), (1,1), (2,2), (3,3,3), (1,1,1), (2), (3), (1), (2,2), (3,3), (1,1), (2,2,2), (3), (1,1), (2,2,2), (3,3,3), (1), (2), (3), ... -> 3, 1, 2, 2, 3, 3, 1, 1, 1, 2, 2, 2, 3, 1, 2, 3, 3, 1, 1, 1, ...
Apply the same process to the third sequence and the original sequence reappears:
(3), (1), (2,2), (3,3), (1,1,1), (2,2,2), (3), (1), (2), (3,3), (1,1,1), (2), (3), (1,1), (2,2), (3,3,3), (1,1,1), (2,2,2), (3), (1), ... -> 1, 1, 2, 2, 3, 3, 1, 1, 1, 2, 3, 1, 1, 2, 2, 3, 3, 3, 1, 1, ...
		

Crossrefs

Cf. A000002, A025142, A025143. A288723 and A288725 are the first and third sequences in this 3-Ouroboros.

Programs

  • PARI
    See Links section.

Extensions

Data corrected by Rémy Sigrist, Oct 07 2017

A288723 First sequence of a Kolakoski 3-Ouroboros, i.e., sequence of 1s, 2s and 3s that begins a chain of three distinct sequences where successive run-length encodings produce seq(1) -> seq(2) -> seq(3) -> seq(1).

Original entry on oeis.org

1, 1, 2, 2, 3, 3, 1, 1, 1, 2, 3, 1, 1, 2, 2, 3, 3, 3, 1, 1, 1, 2, 2, 2, 3, 1, 2, 3, 3, 1, 1, 1, 2, 3, 3, 1, 1, 2, 2, 2, 3, 3, 3, 1, 2, 3, 3, 1, 1, 2, 2, 3, 3, 3, 1, 2, 3, 3, 1, 1, 2, 2, 3, 3, 3, 1, 1, 1, 2, 2, 2, 3, 1, 1, 2, 2, 2, 3, 1, 2, 2, 3, 3, 1, 1
Offset: 1

Author

Anthony Sand, Jun 14 2017

Keywords

Comments

The Kolakoski sequence, A000002, is its own run-length encoding: if you write down the lengths of the runs of 1 and 2, the same sequence reappears, i.e., A000002 = runlength(A000002). Next, runlength(A025142) = A025143 and runlength(A025143) = A025142. The run-lengths of the sequence above yield a second sequence whose run-lengths yield a third sequence whose run-lengths yield the original sequence:
seq(1) = 1,1,2,2,3,3,1,1,1,2,3,1,1,2,2,3,3,3,1,1,1,2,2,2,3,1,2,3,3,1,1,1,2,3,3,...
seq(2) = 2,2,2,3,1,1,2,2,3,3,3,1,1,1,2,3,1,2,2,3,3,1,1,2,2,2,3,1,1,2,2,2,3,3,3,...
seq(3) = 3,1,2,2,3,3,1,1,1,2,2,2,3,1,2,3,3,1,1,1,2,3,1,1,2,2,3,3,3,1,1,1,2,2,2,...
It seems possible to create arbitrarily long chains of distinct integer sequences, seq(1), seq(2)..seq(n), in which runlength(seq(i)) = seq(i+1) for (i=1,n-1) and runlength(seq(n)) = seq(1). When n=5, one possible chain is:
seq(1) = 1,1,2,2,3,3,4,4,4,5,5,5,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,5,...
seq(2) = 2,2,2,3,3,3,4,4,4,5,5,5,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,5,...
seq(3) = 3,3,3,3,4,4,4,4,5,5,5,5,1,1,1,1,2,2,2,2,3,3,3,3,3,4,5,1,1,2,2,3,3,3,...
seq(4) = 4,4,4,4,4,5,1,1,2,2,3,3,3,4,4,4,5,5,5,5,1,1,1,1,2,2,2,2,3,3,3,3,3,...
seq(5) = 5,1,2,2,3,3,4,4,4,5,5,5,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,4,...
When n=10, one possible chain begins and ends:
seq(1) = 1,1,2,2,3,3,4,4,4,5,5,5,6,6,6,7,7,7,7,8,8,8,8,9,9,9,9,10,10,10,10,10,...
[...]
seq(10) = 10,1,2,2,3,3,4,4,4,5,5,5,6,6,6,6,7,7,7,7,8,8,8,8,9,9,9,9,9,10,10,10,10,10,...
These chains might be called Kolakoski n-Ouroboroi, after the legendary serpent Ouroboros that bites its own tail. This sequence, A288723, is the first of one possible 3-Ouroboros, but any set of three distinct integers can seed a 3-Ouroboros. If the seed is (2,3,5), the 3-Ouroboros is:
seq(1) = 2,2,2,3,3,3,5,5,5,2,2,2,3,3,3,5,5,5,5,5,2,2,2,2,2,3,3,3,3,3,5,5,5,5,5,...
seq(2) = 3,3,3,3,3,5,5,5,5,5,2,2,3,3,5,5,5,2,2,2,3,3,3,3,3,5,5,5,5,5,2,2,2,2,2,...
seq(3) = 5,5,2,2,3,3,5,5,5,2,2,2,3,3,3,5,5,5,5,5,2,2,2,2,2,3,3,3,3,3,5,5,2,2,3,3,...
For n > 3, the integer set can repeat integers if the same integer does not occur consecutively or at the beginning and end of the set. If the seed is (1,2,1,3), the 4-Ouroboros is:
seq(1) = 1,1,2,1,1,1,3,1,2,1,1,3,1,1,1,2,2,2,1,3,1,1,2,1,3,1,1,1,2,2,2,1,1,1,...
seq(2) = 2,1,3,1,1,1,2,1,3,3,1,1,2,1,1,1,3,3,3,1,1,1,2,1,1,3,3,1,2,1,1,1,3,3,3,...
seq(3) = 1,1,1,3,1,1,2,2,1,3,3,3,1,2,2,1,1,3,3,1,2,2,2,1,1,1,3,1,1,2,1,3,1,1,1,...
seq(4) = 3,1,2,2,1,3,1,2,2,2,1,3,3,1,2,1,1,1,3,1,2,1,1,3,3,1,1,2,1,1,1,3,1,2,2,...
The existence of Kolakoski p-Ouroboros sequences for any positive integer p is proved in my paper 'What Is the Long Range Order in the Kolakoski Sequence?' from 1997. - Michel Dekking, Feb 05 2018

Examples

			Write down the run-lengths of the sequence, or the lengths of the runs of 1s, 2s and 3s. This yields a second and different sequence of 1s, 2s and 3s, A288724. The run-lengths of this second sequence yield a third and different sequence, A288725. The run-lengths of this third sequence yield the original sequence. For example, bracket the runs of distinct integers, then replace the original digits with the run-lengths to create the second sequence:
(1,1), (2,2), (3,3), (1,1,1), (2), (3), (1,1), (2,2), (3,3,3), (1,1,1), (2,2,2), (3), (1), (2), (3,3), (1,1,1), (2), (3,3), (1,1), (2,2,2), ... -> 2, 2, 2, 3, 1, 1, 2, 2, 3, 3, 3, 1, 1, 1, 2, 3, 1, 2, 2, 3, ...
Apply the same process to the second sequence and the third sequence appears:
(2,2,2), (3), (1,1), (2,2), (3,3,3), (1,1,1), (2), (3), (1), (2,2), (3,3), (1,1), (2,2,2), (3), (1,1), (2,2,2), (3,3,3), (1), (2), (3), ... -> 3, 1, 2, 2, 3, 3, 1, 1, 1, 2, 2, 2, 3, 1, 2, 3, 3, 1, 1, 1, ...
Apply the same process to the third sequence and the original sequence reappears:
(3), (1), (2,2), (3,3), (1,1,1), (2,2,2), (3), (1), (2), (3,3), (1,1,1), (2), (3), (1,1), (2,2), (3,3,3), (1,1,1), (2,2,2), (3), (1), ... -> 1, 1, 2, 2, 3, 3, 1, 1, 1, 2, 3, 1, 1, 2, 2, 3, 3, 3, 1, 1, ...
		

References

  • F. M. Dekking: "What is the long range order in the Kolakoski sequence?" in: The Mathematics of Long-Range Aperiodic Order, ed. R. V. Moody, Kluwer, Dordrecht (1997), pp. 115-125.

Crossrefs

Cf. A000002, A025142, A025143. The second and third sequences in this 3-Ouroboros are A288724 and A288725.

A287515 a(n) = position of n-th 0 when sequence is written in base 2.

Original entry on oeis.org

2, 7, 8, 9, 11, 12, 15, 20, 21, 27, 29, 30, 32, 34, 38, 44, 50, 52, 53, 54, 55, 56, 58, 59, 60, 62, 64, 65, 68, 70, 73, 74, 77, 78, 80, 83, 85, 86, 89, 91, 95, 98, 101, 108, 109, 110, 114, 116, 120, 127, 128, 134, 136, 137, 138, 139, 140, 141, 143, 144, 145, 146, 147, 150, 151, 152, 154, 155, 157, 158, 159, 162
Offset: 1

Author

Anthony Sand, May 26 2017

Keywords

Comments

A167500 lists the positions of 1's when the sequence is written in binary. This sequence lists the positions of 0's. When written in binary, it begins 10, 111, 1000, 1001, 1011... The first 0 appears at position 2, so a(1) = 2 = 10. The second 0 appears at position 7, so a(2) = 7 = 111. The third 0 appears at position 8, so a(3) = 8 = 1000. The sequence then becomes self-generating, because entries are added to it faster than 0's are detected in it.

Examples

			a(1) = zeropos([10...],1) = 2,
a(2) = zeropos([10,111,1000...],2) = 7,
a(3) = zeropos([10,111,1000...],3) = 8,
a(4) = zeropos([10,111,1000...],4) = 9,
a(5) = zeropos([10,111,1000,1001...],5) = 11.
		

Crossrefs

Programs

  • PARI
    { zeroposseq()= smx=100; s=vector(smx); s[1]=2; s[2]=7; s[3]=8; si=0; dig=digits(s[1],2); di=1; i=1; dl=0; while(si#dig, di++; dig=digits(s[di],2); i=1; ); ); }

Formula

a(n) = zeropos([sequence],n).

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

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)

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

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))

A261337 Digit-sums in an incremental base that adjusts itself as the digits of n are generated from right to left.

Original entry on oeis.org

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

Author

Anthony Sand, Aug 15 2015

Keywords

Comments

In a standard base, the digits are generated from right to left by finding (n modulo base) and dividing by the base, until n = 0. In this incremental base, the base is first set equal to 2, then increases according to the digits generated by (n modulo base). For example, 5 = 21 in this base because 5 mod 2 = 1, int(5/2) = 2, 2 mod (2+1 = 3) = 2 and int(2/3) = 0. When n is a power of 2, the base remains 2 throughout, because all digits generated from right to left are 0 until the final digit.
Note that a(2n) = a(n). - Franklin T. Adams-Watters, Oct 09 2015

Examples

			n = 11
base = 2
11 mod base = 11 mod 2 = 1
int(11/2) = 5
base + 1 = 3
5 mod base = 5 mod 3 = 2
int(5/3) = 1.
base + 2 = 5
1 mod base = 1 mod 5 = 1
int(1/5) = 0
Therefore incbase(11) = 121 and digsum(11,incbase) = 4.
n = 23
base = 2
23 mod base = 23 mod 2 = 1
int(23/2) = 11
base + 1 = 3
11 mod base = 11 mod 3 = 2
int(11/3) = 3.
base + 2 = 5
3 mod base = 3 mod 5 = 3
int(3/5) = 0
Therefore incbase(23) = 321 and digsum(23,incbase) = 6.
		

Crossrefs

Cf. A108731.

Programs

  • PARI
    n=0; nmx=1000; d=vector(20); bs=vector(20); while(n < nmx, n++; b=2; nn=n; di=0; while(nn>0, di++; d[di] = nn % b; nn \= b; b += d[di]; ); s = sum(i=1,di,d[i]); print1(s,", "); );

A259497 a(n) = number of steps before A055641(num(i)) = 0, when num(i) = num(i-1) + A055641(num(i-1)) and num(0) = 10^n, where A055641(n) is the number of zero digits in n.

Original entry on oeis.org

1, 10, 96, 918, 8778, 83970, 803652, 7695702, 73736351, 706940003, 6782083197, 65107856455, 625462980243, 6012764576492, 57843691102715, 556865542063090, 5364870125881211, 51722954280818076, 499024949301954326, 4818086348226292202, 46551954003050282966
Offset: 1

Author

Anthony Sand, Jun 29 2015

Keywords

Examples

			For example, when num(0) = 10^1 = 10, A055641(10) = 1. 10 + 1 = 11 and A055641(11) = 0. Therefore a(1) = 1, because the procedure has taken one step before A055641(num(i)) = 0.
a(2) begins with num(0) = 10^2 = 100.
1: 100 + A055641(100) = 100 + 2 = 102.
2: 102 + A055641(102) = 102 + 1 = 103.
.
.
9: 109 + A055641(109) = 109 + 1 = 110.
10: 110 + A055641(110) = 110 + 1 = 111.
At the next step, A055641(111) = 0, so the procedure takes ten steps before A055641(num(i)) = 0 and a(2) = 10.
		

Crossrefs

Cf. A055641.

Programs

  • PARI
    { b=10; digmx=10; for(ni=2,digmx, n=b^(ni-1); s=0; until(z==0, d=digits(n,b); z=sum(i=2,ni,if(d[i]==0,1,0)); n+=z; s++; ); print1(s-1,", "); ); }

Extensions

a(12)-a(21) from Hiroaki Yamanouchi, Aug 02 2015