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-10 of 19 results. Next

A070972 Length of longest run of consecutive 1's in binary expansion of 3^n (A004656).

Original entry on oeis.org

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

Views

Author

Frank Schwellinger (nummer_eins(AT)web.de), Jan 03 2003

Keywords

Examples

			3^11 = (101011001111111011) binary, so a(11) = 7.
		

Crossrefs

Cf. A004656 and A011754.

Programs

  • Mathematica
    f[n_Integer] := Block[{p = Flatten[ Position[ Prepend[ IntegerDigits[2*3^n, 2], 0], 0]]}, Max[Drop[p, 1] - Drop[p, -1]] - 1]; Table[ f[n], {n, 0, 103}]

Extensions

Edited by Robert G. Wilson v, Jan 04 2002

A004642 Powers of 2 written in base 3.

Original entry on oeis.org

1, 2, 11, 22, 121, 1012, 2101, 11202, 100111, 200222, 1101221, 2210212, 12121201, 102020102, 211110211, 1122221122, 10022220021, 20122210112, 111022121001, 222122012002, 1222021101011, 10221112202022, 21220002111121, 120210012000012, 1011120101000101, 2100010202000202
Offset: 0

Views

Author

Keywords

Comments

When n is odd, a(n) ends in 1, and when n is even, a(n) ends in 2, since 2^n is congruent to 1 mod 3 when n is odd and to 2 mod 3 when n is even. - Alonso del Arte Dec 11 2009
Sloane (1973) conjectured a(n) always has a 0 between the most and least significant digits if n > 15 (see A102483 and A346497).
Erdős (1978) conjectured that for n > 8 a(n) has at least one 2 (see link to Terry Tao's blog). - Dmitry Kamenetsky, Jan 10 2017

References

  • N. J. A. Sloane, The Persistence of a Number, J. Recr. Math. 6 (1973), 97-98.

Crossrefs

Cf. A000079: powers of 2 written in base 10.
Cf. A004643, ..., A004655: powers of 2 written in base 4, 5, ..., 16.
Cf. A004656, A004658, A004659, ..., A004663: powers of 3 written in base 2, 4, 5, ..., 9.

Programs

  • Magma
    [Seqint(Intseq(2^n, 3)): n in [0..30]]; // G. C. Greubel, Sep 10 2018
  • Mathematica
    Table[FromDigits[IntegerDigits[2^n, 3]], {n, 25}] (* Alonso del Arte Dec 11 2009 *)
  • PARI
    a(n)=fromdigits(digits(2^n,3)) \\ M. F. Hasler, Jun 23 2018
    

A011754 Number of ones in the binary expansion of 3^n.

Original entry on oeis.org

1, 2, 2, 4, 3, 6, 6, 5, 6, 8, 9, 13, 10, 11, 14, 15, 11, 14, 14, 17, 17, 20, 19, 22, 16, 18, 24, 30, 25, 25, 25, 26, 26, 34, 29, 32, 27, 34, 36, 32, 28, 39, 38, 39, 34, 34, 45, 38, 41, 33, 41, 46, 42, 35, 39, 42, 39, 40, 42, 48, 56, 56, 49, 57, 56, 51, 45, 47, 55, 55, 64, 68, 58
Offset: 0

Views

Author

Allan C. Wechsler, Dec 11 1999

Keywords

Comments

Conjecture: a(n)/n tends to log(3)/(2*log(2)) = 0.792481250... (A094148). - Ed Pegg Jr, Dec 05 2002
Senge & Straus prove that for every m, there is some N such that for all n > N, a(n) > m. Dimitrov & Howe make this effective, proving that for n > 25, a(n) > 22. - Charles R Greathouse IV, Aug 23 2021
Ed Pegg's conjecture means that about half of the bits of 3^n are nonzero. It appears that the same is true for 5^n (A000351, cf. A118738) and 7^n (A000420). - M. F. Hasler, Apr 17 2024

References

  • S. Wolfram, "A new kind of science", p. 903.

Crossrefs

Cf. A007088, A000120 (Hamming weight), A000244 (3^n), A004656, A261009, A094148.
Cf. A118738 (same for 5^n).

Programs

Formula

a(n) = A000120(3^n). - Benoit Cloitre, Dec 06 2002
a(n) = A000120(A000244(n)). - Reinhard Zumkeller, Aug 14 2015

Extensions

More terms from Stefan Steinerberger, Apr 03 2006

A004655 Powers of 2 written in base 16.

Original entry on oeis.org

1, 2, 4, 8, 10, 20, 40, 80, 100, 200, 400, 800, 1000, 2000, 4000, 8000, 10000, 20000, 40000, 80000, 100000, 200000, 400000, 800000, 1000000, 2000000, 4000000, 8000000, 10000000, 20000000, 40000000, 80000000
Offset: 0

Views

Author

Keywords

Comments

10^(Floor[n/4]) | a(n). The first term of each value cycles the pattern {1, 2, 4, 8}. - G. C. Greubel, Sep 10 2018

Crossrefs

Cf. A000079, A004643, ..., A004654: powers of 2 written in base 10, 4, 5, ..., 15.
Cf. A000244, A004656, A004658, A004659, ... : powers of 3 in base 10, 2, 4, 5, ...

Programs

  • Magma
    [Seqint(Intseq(2^n, 16)): n in [0..30]]; // G. C. Greubel, Sep 10 2018
    
  • Mathematica
    Table[FromDigits[IntegerDigits[2^n, 16]], {n, 50}] (* G. C. Greubel, Sep 11 2018 *)
  • PARI
    apply( a(n)=2^(n%4)*10^(n\4), [0..30]) \\ M. F. Hasler, Jun 22 2018
    
  • Python
    def A004655(n): return 10**(n>>2)<<(n&3) # Chai Wah Wu, Jan 27 2023

Formula

a(n) = 2^(n mod 4)*10^floor(n/4). - M. F. Hasler, Jun 22 2018
From Chai Wah Wu, Sep 03 2020: (Start)
a(n) = 10*a(n-4) for n > 3.
G.f.: -(2*x + 1)*(4*x^2 + 1)/(10*x^4 - 1). (End)

A004658 Powers of 3 written in base 4.

Original entry on oeis.org

1, 3, 21, 123, 1101, 3303, 23121, 202023, 1212201, 10303203, 32122221, 223033323, 2001233301, 12011033103, 102033231321, 312233021223, 2210031131001, 13230220113003, 113011321011021, 1011101223033123
Offset: 0

Views

Author

Keywords

Crossrefs

Cf. A000244, A004656, A004659, ... : powers of 3 written in base 10, 2, 5, ...
Cf. A000079, A004643, ..., A004655: powers of 2 written in base 10, 4, 5, ..., 16

Programs

  • Magma
    [Seqint(Intseq(3^n, 4)): n in [0..30]]; // G. C. Greubel, Sep 10 2018
  • Mathematica
    Table[FromDigits[IntegerDigits[3^n, 4]], {n, 0, 40}] (* Vincenzo Librandi, Jun 07 2013 *)
  • PARI
    a(n,b=4,m=3)=fromdigits(digits(m^n,b)) \\ M. F. Hasler, Jun 22 2018
    

A000866 2^n written in base 5.

Original entry on oeis.org

1, 2, 4, 13, 31, 112, 224, 1003, 2011, 4022, 13044, 31143, 112341, 230232, 1011014, 2022033, 4044121, 13143242, 31342034, 113234123, 232023301, 1014102102, 2033204204, 4121413413, 13243332331, 32042220212, 114134440424, 233324431403, 1022204413311
Offset: 0

Views

Author

N. J. A. Sloane, Jacques Haubrich (jhaubrich(AT)freeler.nl)

Keywords

Crossrefs

Cf. A000079, A004642, ..., A004655: powers of 2 written in base 10, 3, 4, ..., 16
Cf. A000244, A004656, A004658, A004659, ... : powers of 3 written in base 10, 2, 4, 5, ...

Programs

  • Mathematica
    Table[FromDigits[IntegerDigits[2^n, 5]], {n, 0, 30}] (* T. D. Noe, Jun 20 2012 *)
  • PARI
    a(n)=fromdigits(digits(2^n,5)) \\ M. F. Hasler, Jun 23 2018

Extensions

More terms from Erich Friedman.

A037095 "Sloping binary representation" of powers of 3 (A000244), slope = -1.

Original entry on oeis.org

1, 1, 3, 1, 3, 9, 11, 17, 19, 25, 123, 65, 195, 169, 171, 753, 435, 249, 2267, 4065, 8163, 841, 843, 31313, 29651, 39769, 38331, 30081, 160643, 49769, 53867, 563377, 700659, 1611961, 760731, 1207073, 5668771, 5566345, 11844619, 8699025, 10386067, 55868313
Offset: 0

Views

Author

Antti Karttunen, Jan 28 1999

Keywords

Examples

			When powers of 3 are written in binary (see A004656), under each other as:
  000000000001 (1)
  000000000011 (3)
  000000001001 (9)
  000000011011 (27)
  000001010001 (81)
  000011110011 (243)
  001011011001 (729)
  100010001011 (2187)
and one collects their bits from the column-0 to NW-direction (from the least to the most significant end), one gets 1 (1), 01 (1), 011 (3), 0001 (1), 00011 (3), 001001 (9), etc. (See A105033 for similar transformation done on nonnegative integers, A001477).
		

Crossrefs

Programs

  • Maple
    A037095:= n-> add(bit_n(3^(n-i), i)*(2^i), i=0..n):
    bit_n := (x, n) -> `mod`(floor(x/(2^n)), 2):
    seq(A037095(n), n=0..41);
    # second Maple program:
    b:= proc(n) option remember; `if`(n=0, 1, (p->
           expand((p-(p mod 2))*x/2)+3^n)(b(n-1)))
        end:
    a:= n-> subs(x=2, b(n) mod 2):
    seq(a(n), n=0..42);  # Alois P. Heinz, Dec 10 2020
  • PARI
    A339601(n) = { my(m=1, s=0); while(n>=m, s += bitand(m,n); m <<= 1; n \= 3); (s); };
    A037095(n) = A339601(3^n); \\ Antti Karttunen, Dec 09 2020
    
  • PARI
    BINSLOPE(f) = n -> sum(i=0,n,bitand(2^(n-i),f(i))); \\ General transformation for these kinds of sequences.
    A037095 = BINSLOPE(n -> 3^n); \\ And its application to A000244. - Antti Karttunen, Dec 09 2020

Formula

a(n) = A339601(A000244(n)). - Antti Karttunen, Dec 09 2020

Extensions

Entry revised Dec 29 2007
More terms from Sean A. Irvine, Dec 08 2020

A037096 Periodic vertical binary vectors computed for powers of 3: a(n) = Sum_{k=0 .. (2^n)-1} (floor((3^k)/(2^n)) mod 2) * 2^k.

Original entry on oeis.org

1, 2, 0, 204, 30840, 3743473440, 400814250895866480, 192435610587299441243182587501623263200, 2911899996313975217187797869354128351340558818020188112521784134070351919360
Offset: 0

Views

Author

Antti Karttunen, Jan 29 1999

Keywords

Comments

This sequence can be also computed with a recurrence that does not explicitly refer to 3^n. See the C program.
Conjecture: For n >= 3, each term a(n), when considered as a GF(2)[X] polynomial, is divisible by the GF(2)[X] polynomial (x + 1) ^ A055010(n-1). If this holds, then for n >= 3, a(n) = A048720(A136386(n), A048723(3,A055010(n-1))).

Examples

			When powers of 3 are written in binary (see A004656), under each other as:
  000000000001 (1)
  000000000011 (3)
  000000001001 (9)
  000000011011 (27)
  000001010001 (81)
  000011110011 (243)
  001011011001 (729)
  100010001011 (2187)
it can be seen that the bits in the n-th column from the right can be arranged in periods of 2^n: 1, 2, 4, 8, ... This sequence is formed from those bits: 1, is binary for 1, thus a(0) = 1. 01, reversed is 10, which is binary for 2, thus a(1) = 2, 0000 is binary for 0, thus a(2)=0, 000110011, reversed is 11001100 = A007088(204), thus a(3) = 204.
		

References

  • S. Wolfram, A New Kind of Science, Wolfram Media Inc., (2002), p. 119.

Crossrefs

Cf. A036284, A037095, A037097, A136386 for related sequences.
Cf. also A004642, A265209, A265210 (for 2^n written in base 3).

Programs

  • Maple
    a(n) := sum( 'bit_n(3^i, n)*(2^i)', 'i'=0..(2^(n))-1);
    bit_n := (x, n) -> `mod`(floor(x/(2^n)), 2);

Formula

a(n) = Sum_{k=0 .. A000225(n)} (floor(A000244(k)/(2^n)) mod 2) * 2^k.
Other identities and observations:
For n >= 2, a(n) = A000215(n-1)*A037097(n) = A048720(A037097(n), A048723(3, A000079(n-1))).

Extensions

Entry revised by Antti Karttunen, Dec 29 2007
Name changed and the example corrected by Antti Karttunen, Dec 05 2015

A004668 Powers of 3 written in base 26. (Next term contains a non-decimal digit.)

Original entry on oeis.org

1, 3, 9, 11, 33, 99, 121, 363
Offset: 0

Views

Author

N. J. A. Sloane, Dec 11 1996

Keywords

Comments

Aliquot divisors of 1089. - Omar E. Pol, Jun 10 2014
The above comment refers to the first 8 terms only. The next term would contain a digit 18, commonly coded as I, if A, B, ... are used for digits > 9. But this does not mean that the sequence is finite. Many other encodings of digits > 9 are conceivable (e.g., using 000, 100, 110, ..., 250 for digits 0, 10, 11, ..., 25). - M. F. Hasler, Jun 22 2018

Crossrefs

Cf. A000244, A004656, A004658, A004659, ..., A004667: powers of 3 in base 10, 2, 4, 5, ..., 13.
Cf. A000079, A004643, ..., A004655: powers of 2 written in base 10, 4, 5, ..., 16.

Programs

  • Mathematica
    Select[Divisors[1089], # < 1089 &] (* Wesley Ivan Hurt, Jun 13 2014 *)
  • PARI
    fordiv(1089, d, (d<1089) && print1(d, ", ")) \\ Michel Marcus, Jun 14 2014
    
  • PARI
    divisors(1089)[^-1] \\ M. F. Hasler, Jun 22 2018
    
  • PARI
    apply( A004668(n,b=26,m=3)=fromdigits(digits(m^n,b)), [0..8]) \\ This implements one possible continuation of the sequence beyond n = 7: write digits in decimal and carry over (so 363*3 = 9I9[26] -> 9*100 + 18*10 + 9 = 1089). - M. F. Hasler, Jun 22 2018

A078839 Numbers k such that the binary expansion of 3^k has the same number of 0's and 1's.

Original entry on oeis.org

2, 12, 69, 73, 150, 184, 252, 328, 339, 464, 483, 541, 729, 747, 758, 763, 1014, 1047, 1090, 1094, 1158, 1264, 1359, 1601, 1679, 1693, 1698, 1780, 2368, 2641, 2815, 3292, 3393, 3606, 3682, 3857, 3909, 3919, 3963, 4087, 4111, 4289, 4314, 5017, 5398, 5466
Offset: 1

Views

Author

Benoit Cloitre, Dec 06 2002

Keywords

Comments

Does the limit of a(n)/n^2 as n -> infinity exist?

Crossrefs

Programs

  • Mathematica
    balanced[n_] := Module[{d=IntegerDigits[n, 2]}, Plus@@d==Length[d]/2]; Select[Range[0, 5500], balanced[3^# ]&]
  • PARI
    is(n)=hammingweight(n=3^n)==hammingweight(bitneg(n,#binary(n))) \\ Charles R Greathouse IV, Mar 29 2013
Showing 1-10 of 19 results. Next