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

A053312 a(n) contains n digits (either '1' or '2') and is divisible by 2^n.

Original entry on oeis.org

2, 12, 112, 2112, 22112, 122112, 2122112, 12122112, 212122112, 1212122112, 11212122112, 111212122112, 1111212122112, 11111212122112, 211111212122112, 1211111212122112, 11211111212122112, 111211111212122112, 2111211111212122112, 12111211111212122112
Offset: 1

Views

Author

Henry Bottomley, Mar 06 2000

Keywords

Comments

Corresponding quotients a(n) / 2^n are in A126933. - Bernard Schott, Mar 15 2023

Examples

			a(5) = 22112 since 22112 = 2^5 * 691 and 22112 contains 5 digits.
		

Crossrefs

Programs

  • Maple
    a:= proc(n) option remember; `if`(n=1, 2, (t-> parse(
          cat(`if`(irem(t, 2^n)=0, 2, 1), t)))(a(n-1)))
        end:
    seq(a(n), n=1..20);  # Alois P. Heinz, Feb 02 2025
  • Mathematica
    Select[Flatten[Table[FromDigits/@Tuples[{1,2},n],{n,20}]],Divisible[ #,2^IntegerLength[#]]&] (* Harvey P. Dale, Jul 01 2019 *)
    RecurrenceTable[{a[1]==2, a[n]==a[n-1]+10^(n-1)(2-Mod[a[n-1]/2^(n-1),2])}, a[n], {n, 1, 20}] (* Paul C Abbott, Feb 03 2025 *)
  • Python
    from itertools import count, islice
    def A053312_gen(): # generator of terms
        a = 0
        for n in count(0):
            yield (a:=a+(10**n if (a>>n)&1 else 10**n<<1))
    A053312_list = list(islice(A053312_gen(),20)) # Chai Wah Wu, Mar 15 2023

Formula

a(n) = a(n-1) + 10^(n-1)*(2-[a(n-1)/2^(n-1) mod 2]), i.e., a(n) ends with a(n-1); if the (n-1)-th term is divisible by 2^n then the n-th term begins with a 2; if not, then the n-th term begins with a 1.

A126933 Quotients arising from sequence A053312.

Original entry on oeis.org

1, 3, 14, 132, 691, 1908, 16579, 47352, 414301, 1183713, 5474669, 27151397, 135646011, 678174568, 6442602909, 18480090517, 85533990571, 424236721848, 4026815626549, 11550150977337, 53458791308981, 265147974756053, 1324666882885839, 6622797918981982, 62916043734881616, 329481245744393933
Offset: 1

Views

Author

Gerry Leversha, Mar 18 2007

Keywords

Comments

Take the decimal number formed by the first n digits of A023396 in reverse order and divide by 2^n.
The sequence A053312 gives n-digit numbers consisting entirely of 1s and 2s which are divisible by 2^n. The quotients upon division form the present sequence. The parity of the n-th term here determines the next term in A023396; if odd, it is a 1 and if even, a 2.
This was set as a problem in the All Union Mathematical Olympiad of 1971 and can be found in the reference cited here.

Examples

			a(4) = A053312(4) / 2^4 = 2112 / 16 = 132. - _David A. Corneth_, Jun 11 2020
		

References

  • J. B. Tabov and P. J. Taylor, Methods of Problem Solving, Book 1, Australian Mathematics Trust, 1996.

Crossrefs

Programs

  • Python
    from itertools import count, islice
    def A126933_gen(): # generator of terms
        a, b = 2, 10
        for n in count(1):
            a+=b if (c:=a>>n)&1 else b<<1
            b *= 10
            yield c
    A126933_list = list(islice(A126933_gen(),20)) # Chai Wah Wu, Mar 16 2023

Formula

a(n) < 0.3 * 5^n. - David A. Corneth, Jun 11 2020

Extensions

Name changed and other minor edits by Ray Chandler, Jun 17 2020

A023407 If any power of 2 ends with k 3's and 6's, they must be the first k terms of this sequence in reverse order.

Original entry on oeis.org

6, 3, 3, 6, 6, 3, 6, 3, 6, 3, 3, 3, 3, 3, 6, 3, 3, 3, 6, 3, 3, 3, 3, 3, 6, 6, 3, 3, 6, 3, 3, 6, 3, 6, 3, 3, 3, 6, 3, 6, 3, 6, 6, 3, 3, 6, 3, 6, 6, 6, 3, 3, 3, 3, 6, 6, 3, 6, 3, 3, 3, 6, 6, 6, 3, 6, 3, 3, 6, 6, 6, 3, 6, 6, 3, 3, 6, 3, 3, 3, 6, 3, 3, 6, 3, 6, 3, 3, 6, 6, 3, 3, 6, 3, 3, 6, 3, 3, 6, 3, 6, 3, 6, 3, 6, 3, 3, 3
Offset: 1

Views

Author

Keywords

Crossrefs

Cf. A023396.

Formula

a(n) = 3*A023396(n).

A023409 If any power of 2 ends with k 6's and 7's, they must be the first k terms of this sequence in reverse order.

Original entry on oeis.org

6, 7, 7, 7, 6, 6, 6, 6, 7, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 6, 7, 7, 6, 6, 7, 7, 7, 6, 6, 6, 6, 7, 6, 7, 7, 7, 7, 7, 6, 6, 6, 6, 7, 6, 7, 7, 6, 6, 6, 6, 7, 6, 7, 6, 6, 7, 6, 7, 7, 7, 6, 6, 6, 7, 6, 7, 7, 7, 6, 6, 6, 6, 6, 7, 6, 6, 6, 7, 7, 6, 7, 7, 6, 7, 7, 6, 7, 6, 6, 7, 7, 6, 7, 6, 7, 7, 6, 6, 7, 7, 6, 6, 7
Offset: 0

Views

Author

Keywords

Comments

From Robert Israel, Mar 30 2018: (Start)
a(0)=6. If the concatenation 6a(n)...a(0) (as a decimal number) is divisible by 2^(n+2) then a(n+1)=6, otherwise a(n+1)=7.
Pomerance (see link) shows the sequence is not eventually periodic. (End)

Crossrefs

Programs

  • Maple
    a[0]:= 6: v:= 6:
    for n from 1 to 100 do
      if 6*10^n+v mod 2^(n+1)=0 then a[n]:= 6 else a[n]:= 7 fi;
      v:= v + a[n]*10^n
    od:
    seq(a[i],i=0..100); # Robert Israel, Mar 30 2018

A207778 Smallest multiple of 2^n using only 1's and 2's.

Original entry on oeis.org

1, 2, 12, 112, 112, 2112, 2112, 122112, 122112, 12122112, 12122112, 12122112, 111212122112, 1111212122112, 11111212122112, 11111212122112, 11111212122112, 11111212122112, 111211111212122112, 111211111212122112, 111211111212122112, 111211111212122112
Offset: 0

Views

Author

Lekraj Beedassy, Feb 20 2012

Keywords

Comments

An induction-based argument can be used to show that this sequence is actually infinite.
Problem 1, proposed during the 5th All-Soviet-Union Mathematical Competition in 1971 at Riga (Pertsel link), asks for a proof that this sequence is infinite. - Bernard Schott, Mar 20 2023

References

  • J. B. Tabov and P. J. Taylor, Methods of Problem Solving, Book 1, Australian Mathematics Trust, 1996.

Crossrefs

Programs

  • Mathematica
    Table[m = 1; p = 2^k; While[Total@ DigitCount[m p][[3 ;; -1]] > 0, m++]; m p, {k, 0, 11}] (* Michael De Vlieger, Mar 17 2023 *)
  • PARI
    a(n) = my(k=1, d=digits(k*2^n)); while (!((vecmin(d)>=1) && (vecmax(d)<=2)), k++; d=digits(k*2^n)); k*2^n; \\ Michel Marcus, Mar 15 2023

Formula

a(n) <= A053312(n).

Extensions

More terms from Alois P. Heinz, Feb 20 2012

A342932 The unique sequence {a(1), a(2), a(3), a(4), ...} of digits 1, 2, or 3 such that the number a(n)a(n-1)...a(2)a(1), read in base 6, is divisible by 3^n.

Original entry on oeis.org

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

Views

Author

Eugen Ionascu, Mar 29 2021

Keywords

Comments

The distribution seems to be uniform but random (empirical observation).
To prove that such a digit sequence exists and is unique is a good (but uncommon) example of a proof by induction.

Examples

			3 is divisible by 3^1;
13_6 = 1*6 + 3 = 9, which is divisible by 3^2,
213_6 = 2*6^2 + 1*6 + 3 = 81, which is divisible by 3^3.
		

Crossrefs

Programs

  • Mathematica
    nd[n_] := Module[{k, i, s, ss, L, a}, L = Array[f, n]; f[1] = 3;
      Do[s = Sum[6^(k - 1)*f[k], {k, 1, i - 1}];
       ss = Mod[2^(i - 1)*s/3^(i - 1), 3];
       If[ss == 0, f[i] = 3, If[ss == 1, f[i] = 2, f[i] = 1]], {i, 2, n}];
      s = Sum[6^(k - 1)*f[k], {k, 1, n}];
      {L, s/3^n}]
  • PARI
    { q=0; t=1; for (n=1, 105, print1 (d=[3,1,2][1+lift(-q/Mod(t,3))]", "); q=(t*d+q)/3; t*=2) } \\ Rémy Sigrist, Apr 15 2021
  • Python
    n, div, divnum = 0, 1, 0
    while n < 87:
        div, a = 3*div, 1
        while (a*6**n+divnum)%div != 0:
            a = a+1
        divnum, n = divnum+a*6**n, n+1
        print(a, end=', ') # A.H.M. Smeets, Apr 13 2021
    
Showing 1-6 of 6 results.