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 41-50 of 60 results. Next

A173933 The number of numbers m < k/2 such that m/k is a reduced fraction in the Cantor set, where k= A173931(n).

Original entry on oeis.org

1, 2, 3, 3, 4, 8, 6, 15, 6, 6, 8, 15, 8, 12, 8, 8, 10, 24, 27, 16, 12, 9, 63, 10, 16, 12, 63, 20, 12, 11, 10, 36, 12, 56, 12, 12, 44, 12, 15, 36, 12, 16, 120, 60, 110, 24, 16, 18, 24, 225
Offset: 1

Views

Author

T. D. Noe, Mar 03 2010

Keywords

Comments

When k is a prime of the form (3^r-1)/2, then the m are 2^r-1 numbers (greater than 0) whose base-3 representation consists of only 0's and 1's. Hence, for r=3,7, and 13, the primes k are 13, 1093, and 797161, and the number of m < k/2 is 3, 63, and 4095.

Examples

			When k=40, then 1/k, 3/k, 9/k, and 13/k have base-3 representations containing only the digits 0 and 2.
		

Crossrefs

Programs

  • Mathematica
    Length /@ Last[Transpose[cantor]] (* see A173931 *)

Extensions

Name qualified by Peter Munn, Jul 14 2019

A262096 Triangle read by rows: numbers c from the set of arithmetic triples a < b < c (three numbers in arithmetic progression) where a and b are terms of A005836.

Original entry on oeis.org

2, 6, 5, 8, 7, 5, 18, 17, 15, 14, 20, 19, 17, 16, 11, 24, 23, 21, 20, 15, 14, 26, 25, 23, 22, 17, 16, 14, 54, 53, 51, 50, 45, 44, 42, 41, 56, 55, 53, 52, 47, 46, 44, 43, 29, 60, 59, 57, 56, 51, 50, 48, 47, 33, 32, 62, 61, 59, 58, 53, 52, 50, 49, 35, 34, 32
Offset: 1

Views

Author

Max Barrentine, Sep 10 2015

Keywords

Comments

The first term in each row of the triangle is a term of A005823; these are also the local maxima. From this term until the next row, the first differences are A236313.

Examples

			Each term is generated from arithmetic sequences started from pairs of terms from A005836. The order is according to the arithmetic triples 0, 1, a(1)=2; 0, 3, a(2)=6; 1, 3, a(3)=5; 0, 4, a(4)=8; 1, 4, a(5)=7; 3, 4, a(6)=5; ...
As a triangle, sequence starts:
   2;
   6,  5;
   8,  7,  5;
  18, 17, 15, 14;
  20, 19, 17, 16, 11;
  24, 23, 21, 20, 15, 14;
  26, 25, 23, 22, 17, 16, 14;
  54, 53, 51, 50, 45, 44, 42, 41;
  ...
		

Crossrefs

Programs

  • PARI
    isok(n) = (n==0) || (vecmax(digits(n, 3)) != 2);
    lista(nn) = {oks = select(x->isok(x), vector(nn, n, n-1)); for (n=2, #oks, for (k=1, n-1, print1(2*oks[n]-oks[k], ", ");););} \\ Michel Marcus, Sep 12 2015

Extensions

Name corrected by Max Barrentine, May 24 2016

A330167 Length of the longest run of 1's in the ternary expression of n.

Original entry on oeis.org

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

Views

Author

Joshua Oliver, Dec 04 2019

Keywords

Comments

All numbers appear in this sequence. Numbers of the form (3^n-1)/2 (A003462(n)) have n 1'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 1 in its ternary expression.

Examples

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

Crossrefs

Equals zero iff n is in A005823.

Programs

  • Mathematica
    Table[Max@FoldList[If[#2==1,#1+1,0]&,0,IntegerDigits[n,3]],{n,0,90}]
    Table[Max[Length/@Select[Split[IntegerDigits[n,3]],MemberQ[#,1]&]],{n,0,100}]/.(-\[Infinity]->0) (* Harvey P. Dale, Jan 07 2023 *)

Formula

a(A003462(n)) = a((3^n-1)/2) = n.
a(n) = 0 iff n is in A005823.

A338241 For any m >= 0, a(3*m) = 3*a(m), a(3*m+1) = 1-3*a(m), a(3*m+2) = 3*a(m)-1.

Original entry on oeis.org

0, 1, -1, 3, -2, 2, -3, 4, -4, 9, -8, 8, -6, 7, -7, 6, -5, 5, -9, 10, -10, 12, -11, 11, -12, 13, -13, 27, -26, 26, -24, 25, -25, 24, -23, 23, -18, 19, -19, 21, -20, 20, -21, 22, -22, 18, -17, 17, -15, 16, -16, 15, -14, 14, -27, 28, -28, 30, -29, 29, -30, 31
Offset: 0

Views

Author

Rémy Sigrist, Oct 18 2020

Keywords

Comments

This sequence is a variant of A117966.
This sequence is a bijection from N = [0..+oo) to Z = (-oo..+oo).

Examples

			For n = 0:
- a(3*0) = 3*a(0),
- so a(0) = 0.
For n = 1:
- a(1) = 1 - 3*a(0) = 1.
For n = 2:
- a(2) = 3*a(0) - 1 = -1.
For n = 4:
- a(4) = 1 - 3*a(1) = -2.
		

Crossrefs

Cf. A005823, A117966, A338242-A338243 (bisections).

Programs

  • PARI
    a(n) = { if (n==0, return (0), my (d=n%3, m=n\3); if (d==0, 3*a(m), d==1, 1-3*a(m), 3*a(m)-1)) }

Formula

Sum_{k = 0..n} a(k) >= 0 with equality iff n belongs to A005823.

A044995 Numbers whose base-3 representation contains exactly one 0 and one 2.

Original entry on oeis.org

6, 11, 15, 19, 21, 32, 34, 38, 42, 46, 48, 58, 64, 66, 95, 97, 103, 113, 115, 119, 123, 127, 129, 139, 145, 147, 175, 193, 199, 201, 284, 286, 292, 310, 338, 340, 346, 356, 358, 362, 366, 370, 372, 382, 388, 390, 418, 436, 442, 444
Offset: 1

Views

Author

Keywords

Crossrefs

Subsequence of A039276.

Programs

  • Maple
    F:= proc(n) local i,j,t;
    t:= (3^n-1)/2;
    op(sort([seq(seq(t - 3^i + 3^j, i= {$0..j-1, $j+1..n-2}),j=0..n-1)]))
    end proc:
    map(F, [$2..7]); # Robert Israel, Mar 11 2020
  • Mathematica
    Select[Range[500],DigitCount[#,3,0]==DigitCount[#,3,2]==1&] (* Harvey P. Dale, Sep 04 2023 *)
  • Python
    from sympy.ntheory import count_digits
    def ok(n): d = count_digits(n, 3); return d[0] == 1 and d[2] == 1
    print(list(filter(ok, range(500)))) # Michael S. Branicky, Jun 11 2021

A097253 Numbers whose set of base 7 digits is {0,6}.

Original entry on oeis.org

0, 6, 42, 48, 294, 300, 336, 342, 2058, 2064, 2100, 2106, 2352, 2358, 2394, 2400, 14406, 14412, 14448, 14454, 14700, 14706, 14742, 14748, 16464, 16470, 16506, 16512, 16758, 16764, 16800, 16806, 100842, 100848, 100884, 100890, 101136
Offset: 1

Views

Author

Ray Chandler, Aug 03 2004

Keywords

Comments

n such that there exists a permutation p_1, ..., p_n of 1, ..., n such that i + p_i is a power of 7 for every i.

Crossrefs

Programs

  • Magma
    [n: n in [0..200000] | Set(IntegerToSequence(n, 7)) subset {0, 6}]; // Vincenzo Librandi, May 25 2012
    
  • Mathematica
    fQ[n_]:=Union@Join[{0,6},IntegerDigits[n,7]]=={0,6};Select[Range[0,140000],fQ] (* Vincenzo Librandi, May 25 2012 *)
    FromDigits[#,7]&/@Tuples[{0,6},6] (* This program is several thousand times faster than the first program, above. *) (* Harvey P. Dale, Aug 12 2023 *)
  • Maxima
    a[0]:0$ a[n]:=7*a[floor(n/2)]+3*(1-(-1)^n)$ makelist(a[n], n, 0, 36); /* Bruno Berselli, May 25 2012 */

Formula

a(n) = 6*A033044(n).
a(2n) = 7*a(n), a(2n+1) = a(2n)+6.

Extensions

Offset corrected by Arkadiusz Wesolowski, Nov 09 2013

A097255 Numbers whose set of base 9 digits is {0,8}.

Original entry on oeis.org

0, 8, 72, 80, 648, 656, 720, 728, 5832, 5840, 5904, 5912, 6480, 6488, 6552, 6560, 52488, 52496, 52560, 52568, 53136, 53144, 53208, 53216, 58320, 58328, 58392, 58400, 58968, 58976, 59040, 59048, 472392, 472400, 472464, 472472, 473040
Offset: 0

Views

Author

Ray Chandler, Aug 03 2004

Keywords

Comments

n such that there exists a permutation p_1, ..., p_n of 1, ..., n such that i + p_i is a power of 9 for every i.

Crossrefs

Programs

  • Magma
    [n: n in [0..500000] | Set(IntegerToSequence(n, 9)) subset {0, 8}]; // Vincenzo Librandi, May 25 2012
    
  • Mathematica
    fQ[n_]:=Union@Join[{0,8},IntegerDigits[n,9]]=={0,8};Select[Range[0,500000],fQ] (* or *) FromDigits[#,9]&/@Tuples[{0,8},6](* Vincenzo Librandi, May 25 2012 *)
  • Maxima
    a[0]:0$ a[n]:=9*a[floor(n/2)]+4*(1-(-1)^n)$ makelist(a[n], n, 0, 36); /* Bruno Berselli, May 26 2012 */

Formula

a(n) = 8*A033046(n).
a(2n) = 9*a(n), a(2n+1) = a(2n)+8.

A097257 Numbers whose set of base 11 digits is {0,A}, where A base 11 = 10 base 10.

Original entry on oeis.org

0, 10, 110, 120, 1210, 1220, 1320, 1330, 13310, 13320, 13420, 13430, 14520, 14530, 14630, 14640, 146410, 146420, 146520, 146530, 147620, 147630, 147730, 147740, 159720, 159730, 159830, 159840, 160930, 160940, 161040, 161050, 1610510
Offset: 0

Views

Author

Ray Chandler, Aug 03 2004

Keywords

Comments

n such that there exists a permutation p_1, ..., p_n of 1, ..., n such that i + p_i is a power of 11 for every i.

Crossrefs

Programs

  • Mathematica
    f[n_] := FromDigits[ IntegerDigits[n, 2] /. {1 -> 10}, 11]; Array[f, 33, 0] (* or much slower *)
    fQ[n_] := Union@ Join[{0, 10}, IntegerDigits[n, 11]] == {0, 10}; Select[ Range[0, 1610519], fQ] (* Robert G. Wilson v, May 12 2012 *)
    Join[{0},Union[Flatten[Table[FromDigits[#,11]&/@(Join[{10},#]&/@ Tuples[ {10,0},n]),{n,0,5}]]]] (* Harvey P. Dale, Sep 23 2013 *)
  • PARI
    {for(vv=0,32,
    bvv=binary(vv);
    texp=0;btb=0;
    forstep(i=length(bvv),1,-1,btb=btb+10*bvv[i]*11^texp;texp++);
    print1(btb,", ") )} \\ Douglas Latimer, May 12 2012

Formula

a(n) = 10*A033047(n).
a(2n) = 11*a(n), a(2n+1) = a(2n)+10.

A097258 Numbers whose set of base 12 digits is {0,B}, where B base 12 = 11 base 10.

Original entry on oeis.org

0, 11, 132, 143, 1584, 1595, 1716, 1727, 19008, 19019, 19140, 19151, 20592, 20603, 20724, 20735, 228096, 228107, 228228, 228239, 229680, 229691, 229812, 229823, 247104, 247115, 247236, 247247, 248688, 248699, 248820, 248831, 2737152
Offset: 0

Views

Author

Ray Chandler, Aug 03 2004

Keywords

Comments

n such that there exists a permutation p_1, ..., p_n of 1, ..., n such that i + p_i is a power of 12 for every i.

Crossrefs

Programs

  • Magma
    [n: n in [0..2800000] | Set(IntegerToSequence(n, 12)) subset {0, 11}]; // Vincenzo Librandi, May 26 2012
  • Mathematica
    f[n_] := FromDigits[ IntegerDigits[n, 2] /. {1 -> 11}, 12]; Array[f, 33, 0] (* or much slower *)
    fQ[n_] := Union@ Join[{0, 11}, IntegerDigits[n, 12]] == {0, 11}; Select[ Range[0, 27370162], fQ] (* Robert G. Wilson v, May 12 2012 *)
    FromDigits[#,12]&/@Tuples[{0,11},6] (* Vincenzo Librandi, May 26 2012 *)

Formula

a(n) = 11*A033048(n).
a(2n) = 12*a(n), a(2n+1) = a(2n)+11.

A097259 Numbers whose set of base 13 digits is {0,C}, where C base 13 = 12 base 10.

Original entry on oeis.org

0, 12, 156, 168, 2028, 2040, 2184, 2196, 26364, 26376, 26520, 26532, 28392, 28404, 28548, 28560, 342732, 342744, 342888, 342900, 344760, 344772, 344916, 344928, 369096, 369108, 369252, 369264, 371124, 371136, 371280, 371292, 4455516
Offset: 0

Views

Author

Ray Chandler, Aug 03 2004

Keywords

Comments

n such that there exists a permutation p_1, ..., p_n of 1, ..., n such that i + p_i is a power of 13 for every i.

Crossrefs

Programs

  • Magma
    [n: n in [0..4500000] | Set(IntegerToSequence(n, 13)) subset {0, 12}]; // Vincenzo Librandi, Jun 04 2012
  • Mathematica
    f[n_] := FromDigits[ IntegerDigits[n, 2] /. {1 -> 12}, 13]; Array[f, 33, 0] (* or much slower *)
    fQ[n_] := Union@ Join[{0, 12}, IntegerDigits[n, 13]] == {0, 12}; Select[ Range[0, 4455516 ], fQ] (* Robert G. Wilson v, May 12 2012 *)
    FromDigits[#,13]&/@Tuples[{0,12},5] (* Vincenzo Librandi, Jun 04 2012 *)

Formula

a(n) = 12*A033049(n).
a(2n) = 13*a(n), a(2n+1) = a(2n)+12.
Previous Showing 41-50 of 60 results. Next