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 86 results. Next

A128760 Number of ways to write n as the absolute difference of a power of 2 and a power of 3.

Original entry on oeis.org

1, 4, 1, 1, 0, 3, 0, 3, 1, 0, 0, 1, 0, 2, 0, 1, 0, 1, 0, 1, 0, 0, 0, 2, 0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0
Offset: 0

Views

Author

Reinhard Zumkeller, Mar 25 2007

Keywords

Comments

a(A014121(n)) > 0; the only even numbers m with a(m)>0 are of the form m=3^k-1: a(A024023(n)) > 0;
Conjecture: there exists c>=23 such that a(n)<2 for n>c.

Examples

			a(1) = #{2^1 - 3^0, 2^2 - 3^1, 3^1 - 2^1, 3^2 - 2^3} = 4;
a(2) = #{3^1 - 2^0} = 1;
a(3) = #{2^2 - 3^0} = 1;
a(5) = #{2^3 - 3^1, 2^5 - 3^3, 3^2 - 2^2} = 3;
a(7) = #{2^3 - 3^0, 2^4 - 3^2, 3^2 - 2^1} = 3;
a(8) = #{3^2 - 2^0} = 1;
a(11) = #{3^3 - 2^4} = 1;
a(13) = #{2^4 - 3^1, 2^8 - 3^5} = 2;
a(15) = #{2^4 - 2^0} = 1;
a(17) = #{3^4 - 2^6} = 1;
a(19) = #{3^3 - 2^3} = 1;
a(23) = #{2^5 - 3^2, 3^3 - 2^2} = 2;
a(25) = #{3^3 - 2^1} = 1.
		

Crossrefs

A238976 a(n) = ((3^(n-1)-1)^2)/4.

Original entry on oeis.org

0, 1, 16, 169, 1600, 14641, 132496, 1194649, 10758400, 96845281, 871666576, 7845176329, 70607118400, 635465659921, 5719195722256, 51472775849209, 463255025689600, 4169295360346561, 37523658630539536, 337712928837117289, 3039416363020840000, 27354747277647913201, 246192725530212278416
Offset: 1

Views

Author

Kival Ngaokrajang, Mar 07 2014

Keywords

Comments

If the Cantor square fractal is modified as shown in the illustration (see Links), then 4*a(n) is the total number of holes in the modified Cantor square fractal after n iterations. The total number of sides (outside) is 4*A171498(n-1). The total length of the sides (outside) converges to 20 when the initial total side length is 12 (starting with 5 unit squares).
For the Cantor square fractal, the total number of sides (outside) is 4*A168616(n+2). The total number of holes is 4*A060867(n-1) for n > 1. The total length of the sides (outside) converges to 12 with the same initial condition (i.e., 5 unit square); its maximum is 17.333... and is reached at n = 2, 3. The Cantor square fractal and modified one are not true fractals.
See illustrations in links.

Crossrefs

Programs

  • PARI
    a(n) = ((3^(n-1)-1)^2)/4; \\ Joerg Arndt, Mar 08 2014

Formula

a(n) = (A024023(n-1))^2/4.
G.f.: x*(3*x + 1)/((1-x)*(1-3*x)*(1-9*x)). - Ralf Stephan, Mar 14 2014

A249435 a(1) = 0, after which one less than prime powers p^m with exponent m >= 2.

Original entry on oeis.org

0, 3, 7, 8, 15, 24, 26, 31, 48, 63, 80, 120, 124, 127, 168, 242, 255, 288, 342, 360, 511, 528, 624, 728, 840, 960, 1023, 1330, 1368, 1680, 1848, 2047, 2186, 2196, 2208, 2400, 2808, 3124, 3480, 3720, 4095, 4488, 4912, 5040, 5328, 6240, 6560, 6858, 6888, 7920, 8191, 9408, 10200, 10608, 11448
Offset: 1

Views

Author

Antti Karttunen, Nov 02 2014

Keywords

Crossrefs

One less than A025475.
Subsequence of A181062 and also a subsequence of A249433 (after the initial zero).
Union of sequences A000225, A024023, A024049, A024075, A024127, etc. without their term a(1).
Apart from the first term, subsequence of A045542.

Programs

  • PARI
    list(lim)=my(v=List([0])); lim=lim\1+1; for(m=2,logint(lim,2), forprime(p=2,sqrtnint(lim,m), listput(v, p^m-1))); Set(v) \\ Charles R Greathouse IV, Aug 26 2015
  • Scheme
    (define (A249435 n) (- (A025475 n) 1))
    

Formula

a(n) = A025475(n) - 1.

A263647 Numbers k such that 2^k-1 and 3^k-1 are coprime.

Original entry on oeis.org

1, 2, 3, 5, 7, 9, 13, 14, 15, 17, 19, 21, 25, 26, 27, 29, 31, 34, 37, 38, 39, 41, 45, 47, 49, 51, 53, 57, 59, 61, 62, 63, 65, 67, 71, 73, 74, 79, 81, 85, 87, 89, 91, 93, 94, 97, 98, 101, 103, 107, 109, 111, 113, 118, 122, 123, 125, 127, 133, 134, 135, 137, 139, 141, 142, 145, 147, 149, 151, 153, 157, 158, 159, 163, 167, 169, 171
Offset: 1

Views

Author

Robert Israel, Oct 22 2015

Keywords

Comments

n such that there is no k for which both A014664(k) and A062117(k) divide n.
If n is in the sequence, then so is every divisor of n.
1 and 2 are the only members that are in A006093.
Conjectured to be infinite: see the Ailon and Rudnick paper.

Examples

			gcd(2^1-1, 3^1-1) = gcd(1,2) = 1, so a(1) = 1.
gcd(2^2-1, 3^2-1) = gcd(3,8) = 1, so a(2) = 2.
gcd(2^4-1, 3^4-1) = gcd(15,80) = 5, so 4 is not in the sequence.
		

Crossrefs

Programs

  • Magma
    [n: n in [1..200] | Gcd(2^n-1, 3^n-1) eq 1]; // Vincenzo Librandi, May 01 2016
  • Maple
    select(n -> igcd(2^n-1,3^n-1)=1, [$1..1000]);
  • Mathematica
    Select[Range[200], GCD[2^# - 1, 3^# - 1] == 1 &] (* Vincenzo Librandi, May 01 2016 *)

A283454 The square root of the smallest square referenced in A249025 (Numbers k such that 3^k - 1 is not squarefree).

Original entry on oeis.org

2, 2, 11, 2, 2, 2, 2, 2, 11, 2, 2, 2, 2, 2, 11, 2, 2, 2, 2, 2, 11, 2, 2, 13, 2, 2, 2, 11, 2, 2, 2, 2, 2, 11, 2, 2, 2, 2, 2, 11, 2, 2, 2, 2, 2, 11, 2, 2, 2, 2, 2, 11, 2, 2, 2, 2, 2, 11, 2, 2, 2, 2, 2, 11, 2, 2, 2, 2, 2, 11, 2, 13, 2, 2, 2, 2, 11, 2, 2, 2, 2, 2, 11
Offset: 1

Views

Author

Robert Price, Mar 07 2017

Keywords

Comments

The terms are the smallest prime whose square divides 3^k-1, when it is not squarefree.

Examples

			A249025(3)=5, 3^5-1 = 242 = 2*11*11. 242 is not squarefree the square being 11*11 = 121, the root being 11.
		

Crossrefs

Programs

  • Mathematica
    p[n_] := If[(f = Select[FactorInteger[n], Last[#] > 1 &]) == {}, 1, f[[1, 1]]]; p /@ Select[3^Range[100] - 1, !SquareFreeQ[#] &] (* Amiram Eldar, Feb 12 2021 *)
  • PARI
    lista(nn) = {for (n=1, nn, if (!issquarefree(k = 3^n-1), f = factor(k/core(k)); vsq = select(x->((x%2) == 0), f[,2], 1); print1(f[vsq[1], 1], ", ");););} \\ Michel Marcus, Mar 11 2017

Formula

a(n) = A249739(A024023(A249025(n))). - Amiram Eldar, Feb 12 2021

Extensions

More terms from Michel Marcus, Mar 11 2017

A330168 Length of the longest run of 2's in the ternary expression of n.

Original entry on oeis.org

0, 0, 1, 0, 0, 1, 1, 1, 2, 0, 0, 1, 0, 0, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2, 2, 3, 0, 0, 1, 0, 0, 1, 1, 1, 2, 0, 0, 1, 0, 0, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 3, 3, 4, 0, 0, 1, 0, 0, 1, 1, 1, 2, 0
Offset: 0

Views

Author

Joshua Oliver, Dec 04 2019

Keywords

Comments

All numbers appear in this sequence. Numbers of the form 3^n-1 (A024023(n)) have n 2's in their ternary expression.
The longest run of zeros possible in this sequence is 2, as the last digit of the ternary expression of the integers cycles between 0, 1, and 2, meaning that at least one of three consecutive numbers has a 2 in its ternary expression.

Examples

			For n = 74, the ternary expression of 74 is 2202. The length of the runs of 2's in the ternary expression of 74 are 2 and 1, respectively. The larger of these two values is 2, so a(74) = 2.
   n [ternary n] a(n)
   0 [        0] 0
   1 [        1] 0
   2 [        2] 1
   3 [      1 0] 0
   4 [      1 1] 0
   5 [      1 2] 1
   6 [      2 0] 1
   7 [      2 1] 1
   8 [      2 2] 2
   9 [    1 0 0] 0
  10 [    1 0 1] 0
  11 [    1 0 2] 1
  12 [    1 1 0] 0
  13 [    1 1 1] 0
  14 [    1 1 2] 1
  15 [    1 2 0] 1
  16 [    1 2 1] 1
  17 [    1 2 2] 2
  18 [    2 0 0] 1
  19 [    2 0 1] 1
  20 [    2 0 2] 1
		

Crossrefs

Equals zero iff n is in A005836.

Programs

  • Mathematica
    Table[Max@FoldList[If[#2==2,#1+1,0]&,0,IntegerDigits[n,3]],{n,0,90}]

Formula

a(A024023(n)) = a(3^n-1) = n.
a(n) = 0 iff n is in A005836.

A044972 Numbers whose base-3 representation contains exactly one 0 and two 1's.

Original entry on oeis.org

10, 12, 32, 34, 38, 42, 46, 48, 58, 64, 66, 98, 104, 106, 116, 128, 132, 140, 142, 146, 150, 154, 156, 176, 178, 184, 194, 196, 200, 204, 208, 210, 220, 226, 228, 296, 314, 320, 322, 350, 386, 398, 402, 422, 428, 430, 440, 452
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    Select[Range[500],DigitCount[#,3,0]==1&&DigitCount[#,3,1]==2&] (* Harvey P. Dale, Aug 19 2019 *)
  • PARI
    is(n)=my(d=digits(n,3),fr=vector(3));for(i=1,#d,fr[d[i]+1]++);fr[1]==1&&fr[2]==2 \\ David A. Corneth, Aug 19 2019

A103453 a(n) = 0^n + 3^n - 1.

Original entry on oeis.org

1, 2, 8, 26, 80, 242, 728, 2186, 6560, 19682, 59048, 177146, 531440, 1594322, 4782968, 14348906, 43046720, 129140162, 387420488, 1162261466, 3486784400, 10460353202, 31381059608, 94143178826, 282429536480, 847288609442
Offset: 0

Views

Author

Paul Barry, Feb 06 2005

Keywords

Comments

A transform of 3^n under the matrix A103452.
a(n) is the number of moves required to solve a Towers of Hanoi puzzle of 3 towers in a line (no direct connection between the two towers on the ends) with n pieces to be moved from one end tower to the other. This is easily proved through demonstration. - Roderick Kimball, Nov 22 2015

Crossrefs

Cf. A103452.
Essentially identical to A024023.

Programs

  • Magma
    [0^n+3^n-1: n in [0..30] ]; // Vincenzo Librandi, Apr 30 2011
    
  • Mathematica
    Table[If[n==0, 1, 3^n -1], {n, 0, 30}] (* G. C. Greubel, Jun 18 2021 *)
    LinearRecurrence[{4,-3},{1,2,8},30] (* Harvey P. Dale, Feb 13 2022 *)
  • PARI
    a(n) = if(n==0, 1, 3^n-1); \\ Altug Alkan, Nov 22 2015
    
  • Sage
    [3^n -1 +0^n for n in (0..30)] # G. C. Greubel, Jun 18 2021

Formula

G.f.: (1 -2*x +3*x^2)/((1-x)*(1-3*x)).
a(n) = Sum_{k=0..n} A103452(n, k)*3^k.
a(n) = Sum_{k=0..n} (2*0^(n-k) - 1)*0^(k*(n-k))*3^k.
From G. C. Greubel, Jun 18 2021: (Start)
E.g.f.: 1 - exp(x) + exp(3*x).
a(n) = [n=0] + 2*A003462(n). (End)

A114804 The numbers 3^n-1 written in groups of three digits, with leading zeros omitted.

Original entry on oeis.org

282, 680, 242, 728, 218, 665, 601, 968, 259, 48, 177, 146, 531, 440, 159, 432, 247, 829, 681, 434, 890, 643, 46, 720, 129, 140, 162, 387, 420, 488, 116, 226, 146, 634, 867, 844, 1, 46, 35, 320, 231, 381, 59, 608, 941, 431, 788, 262, 824, 295, 364, 808
Offset: 1

Views

Author

Jonathan Vos Post, Feb 18 2006

Keywords

Examples

			2, 8, 26, 80, 242, 728, 2186, ...
		

Crossrefs

Programs

  • Mathematica
    FromDigits/@Partition[Flatten[IntegerDigits/@(3^Range[30]-1)],3] (* Harvey P. Dale, Jul 04 2021 *)

Extensions

Terms recomputed to use the definition equivalent to A114645. - R. J. Mathar, Jun 23 2014

A125725 Numbers whose base-7 representation is 222....2.

Original entry on oeis.org

0, 2, 16, 114, 800, 5602, 39216, 274514, 1921600, 13451202, 94158416, 659108914, 4613762400, 32296336802, 226074357616, 1582520503314, 11077643523200, 77543504662402, 542804532636816, 3799631728457714, 26597422099204000
Offset: 1

Views

Author

Zerinvary Lajos, Feb 02 2007

Keywords

Examples

			base 7.......decimal
0..................0
2..................2
22................16
222..............114
2222.............800
22222...........5602
222222.........39216
2222222.......274514
22222222.....1921600
222222222...13451202
etc...........etc.
		

Crossrefs

Cf. also A002276, A005610, A020988, A024023, A125831, A125835, A125857 for related or similarly constructed sequences.

Programs

  • GAP
    List([1..25], n-> (7^(n-1) -1)/3); # G. C. Greubel, May 23 2019
  • Magma
    [0] cat [n:n in [1..15000000]| Set(Intseq(n,7)) subset [2]]; // Marius A. Burtea, May 06 2019
    
  • Magma
    [(7^(n-1)-1)/3: n in [1..25]]; // Marius A. Burtea, May 06 2019
    
  • Maple
    seq(2*(7^n-1)/6, n=0..25);
  • Mathematica
    FromDigits[#,7]&/@Table[PadLeft[{2},n,2],{n,0,25}]  (* Harvey P. Dale, Apr 13 2011 *)
    (7^(Range[25]-1) - 1)/3 (* G. C. Greubel, May 23 2019 *)
  • PARI
    vector(25, n, (7^(n-1)-1)/3) \\ Davis Smith, Apr 04 2019
    
  • Sage
    [(7^(n-1) -1)/3 for n in (1..25)] # G. C. Greubel, May 23 2019
    

Formula

a(n) = (7^(n-1) - 1)/3 = 2*A023000(n-1).
a(n) = 7*a(n-1) + 2, with a(1)=0. - Vincenzo Librandi, Sep 30 2010
G.f.: 2*x^2 / ( (1-x)*(1-7*x) ). - R. J. Mathar, Sep 30 2013
From Davis Smith, Apr 04 2019: (Start)
A007310(a(n) + 1) = 7^(n - 1).
A047522(a(n + 1)) = -1*A165759(n). (End)
E.g.f.: (exp(7*x) - 7*exp(x) + 6)/21. - Stefano Spezia, Jan 12 2025

Extensions

Offset corrected by N. J. A. Sloane, Oct 02 2010
Previous Showing 51-60 of 86 results. Next