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 21-30 of 39 results. Next

A082555 Primes whose base-3 representation does not contain a 0.

Original entry on oeis.org

2, 5, 7, 13, 17, 23, 41, 43, 53, 67, 71, 79, 131, 149, 151, 157, 211, 229, 233, 239, 241, 367, 373, 401, 449, 457, 607, 617, 619, 643, 647, 691, 701, 719, 727, 1093, 1097, 1103, 1123, 1129, 1187, 1201, 1213, 1367, 1373, 1427, 1429, 1447, 1453, 1823, 1831, 1861
Offset: 1

Views

Author

Randy L. Ekl, May 03 2003

Keywords

Comments

Primes in A032924. - Robert Israel, Dec 28 2018
The analog "primes without digit 2 in ternary" is A077717. There is no prime > 2 not having the digit 1 in ternary, since then the number is divisible by 2. - M. F. Hasler, Feb 15 2023

Examples

			41 = 1112_3, which contains no 0.
		

Crossrefs

Cf. A032924 (numbers without digit 0 in base 3), A073779, A077267.
Cf. A077717 (primes that are the sum of distinct powers of 3 <=> base-3 representation does not contain a digit 2).

Programs

  • Maple
    select(t -> isprime(t) and not(has(convert(t,base,3),0)), [2,seq(i,i=5..10000,2)]); # Robert Israel, Dec 28 2018
  • PARI
    dec3(s)=while(s>0,if(s%3==0,return(0),s=floor(s/3))); return(1)
    forprime(i=1,20000,if(dec3(i)==1,print1(i,", "),))
    
  • Python
    def is_A082555(n): return is_A032924(n) and A010051(n)
    [p for p in range(1888) if is_A082555(p)] # M. F. Hasler, Feb 15 2023

A370864 Numbers m such that c(0) >= c(1) < c(2), where c(k) = number of k's in the ternary representation of m.

Original entry on oeis.org

2, 6, 8, 18, 20, 24, 26, 35, 47, 51, 54, 56, 59, 60, 61, 62, 65, 69, 72, 73, 74, 75, 78, 80, 89, 101, 105, 107, 137, 141, 143, 153, 155, 159, 162, 164, 167, 168, 169, 170, 173, 177, 179, 180, 181, 182, 183, 185, 186, 187, 188, 191, 195, 197, 207, 209, 213
Offset: 1

Views

Author

Clark Kimberling, Mar 09 2024

Keywords

Examples

			The ternary representation of 20 is 202, for which c(0)=1 >= c(1)=0 < c(2)=2.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[1000], DigitCount[#, 3, 0] >= DigitCount[#, 3, 1] < DigitCount[#, 3, 2] &]

A077266 Triangle of number of zeros when n is written in base k (2 <= k <= n).

Original entry on oeis.org

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

Views

Author

Henry Bottomley, Nov 01 2002

Keywords

Examples

			Rows start:
  1;
  0,1;
  2,0,1;
  1,0,0,1;
  1,1,0,0,1;
  0,0,0,0,0,1;
  3,0,1,0,0,0,1;
  2,2,0,0,0,0,0,1;
  etc.
9 can be written in bases 2-9 as: 1001, 100, 21, 14, 13, 12, 11 and 10, in which case the numbers of zeros are 2,2,0,0,0,0,0,1.
		

Crossrefs

Columns include A023416 and A077267. Row sums are A033093, row maxima are A062842, number of positive terms in each row are A077268.

Programs

  • Mathematica
    Table[Count[#,0]&/@IntegerDigits[n,Range[2,n]],{n,2,15}]//Flatten (* Harvey P. Dale, Jun 02 2025 *)
  • PARI
    T(n, k) = #select(x->(x==0), digits(n, k));
    row(n) = vector(n-1, k, T(n,k+1));
    tabl(nn) = for (n=2, nn, print(row(n))); \\ Michel Marcus, Sep 02 2020

Formula

T(nk, k)=T(n, k)+1; T(nk+m, k)=T(n, k) if 0

A330166 Length of the longest run of 0's in the ternary expression of n.

Original entry on oeis.org

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

Author

Joshua Oliver, Dec 04 2019

Keywords

Comments

All numbers appear in this sequence. The n-th power of 3 (A000244(n)) has n 0's in its 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 0 in its ternary expression.

Examples

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

Crossrefs

Equals zero iff n is in A032924.

Programs

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

Formula

a(A000244(n)) = a(3^n) = n.
a(n) = 0 iff n is in A032924.

A365278 In the binary expansion of n replace each run of k consecutive 1's by the decimal digits of A007931(k) to get the ternary expansion of a(n).

Original entry on oeis.org

0, 1, 3, 2, 9, 10, 6, 4, 27, 28, 30, 11, 18, 19, 12, 5, 81, 82, 84, 29, 90, 91, 33, 31, 54, 55, 57, 20, 36, 37, 15, 7, 243, 244, 246, 83, 252, 253, 87, 85, 270, 271, 273, 92, 99, 100, 93, 32, 162, 163, 165, 56, 171, 172, 60, 58, 108, 109, 111, 38, 45, 46, 21
Offset: 0

Author

Rémy Sigrist, Aug 30 2023

Keywords

Comments

This sequence is a permutation of the nonnegative integers with inverse A365279.
For any pair (b, c) of bases >= 2, we can devise a similar sequence, say F_{b, c}:
- for any d >= 2, let Z_d be the set of zeroless numbers in base d,
- in the base b expansion of n replace each run of consecutive nonzero digits (say corresponding to Z_b(k) for some k > 0) by the base c digits of Z_c(k) to get the base c expansion of F_{b, c}(n),
- F_{b, c} is a permutation of the nonnegative integers with inverse F_{c, b},
- F_{c, d} o F_{b, c} = F_{b, d} and F_{b, b} is the identity,
- in particular the present sequence corresponds to F_{2, 3} and its inverse to F_{3, 2}.

Examples

			The binary expansion of 415 is "110011111", A007931(2) = 2 and A007931(5) = 21, so the ternary expansion of a(415) is "20021", and a(415) = 169.
		

Crossrefs

Programs

  • Mathematica
    A007931[n_]:=Rest[IntegerDigits[n+1,2]]+1;
    A365278[n_]:=FromDigits[Flatten[Map[If[First[#]==1,A007931[Length[#]],#]&,Split[IntegerDigits[n,2]]]],3];
    Array[A365278,100,0] (* Paolo Xausa, Oct 17 2023 *)
  • PARI
    See Links section.

Formula

a(2*n) = 3*a(n).
a(2^k - 1) = A032924(k) for any k > 0.
A077267(a(n)) = A023416(n).

A370860 Numbers m such that c(0) <= c(1) > c(2), where c(k) = number of k's in the ternary representation of m.

Original entry on oeis.org

1, 3, 4, 10, 12, 13, 14, 16, 22, 28, 30, 31, 32, 34, 36, 37, 38, 39, 40, 41, 42, 43, 46, 48, 49, 58, 64, 66, 67, 85, 86, 88, 91, 92, 93, 94, 95, 96, 97, 100, 102, 103, 109, 110, 111, 112, 113, 114, 115, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127
Offset: 1

Author

Clark Kimberling, Mar 03 2024

Keywords

Examples

			The ternary representation of 16 is 121, for which c(0)=0 <= c(1)=2 > c(2)=1.
		

Programs

  • Mathematica
    Select[Range[1000], DigitCount[#, 3, 0] <= DigitCount[#, 3, 1] > DigitCount[#, 3, 2] &]

A370861 Numbers m such that c(0) < c(1) >= c(2), where c(k) = number of k's in the ternary representation of m.

Original entry on oeis.org

1, 4, 5, 7, 10, 12, 13, 14, 16, 22, 31, 32, 34, 37, 38, 39, 40, 41, 42, 43, 44, 46, 48, 49, 50, 52, 58, 64, 66, 67, 68, 70, 76, 85, 91, 93, 94, 95, 97, 98, 103, 104, 106, 109, 111, 112, 113, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 127, 128
Offset: 1

Author

Clark Kimberling, Mar 03 2024

Keywords

Examples

			The ternary representation of 16 is 121, for which c(0)=0 < c(1)=2 >= c(2)=1.
		

Programs

  • Mathematica
    Select[Range[1000], DigitCount[#, 3, 0] < DigitCount[#, 3, 1] >= DigitCount[#, 3, 2] &]

A370862 Numbers m such that c(0) <= c(1) >= c(2), where c(k) = number of k's in the ternary representation of m.

Original entry on oeis.org

1, 3, 4, 5, 7, 10, 11, 12, 13, 14, 15, 16, 19, 21, 22, 28, 30, 31, 32, 34, 36, 37, 38, 39, 40, 41, 42, 43, 44, 46, 48, 49, 50, 52, 58, 64, 66, 67, 68, 70, 76, 85, 86, 88, 91, 92, 93, 94, 95, 96, 97, 98, 100, 102, 103, 104, 106, 109, 110, 111, 112, 113, 114
Offset: 1

Author

Clark Kimberling, Mar 09 2024

Keywords

Examples

			The ternary representation of 15 is 120, for which c(0)=1 <= c(1)=1 >= c(2)=1.
		

Programs

  • Mathematica
    Select[Range[1000], DigitCount[#, 3, 0] <= DigitCount[#, 3, 1] >= DigitCount[#, 3, 2] &]

A370866 Positive integers m such that c(0) >= c(1) <= c(2), where c(k) = number of k's in the ternary representation of m.

Original entry on oeis.org

2, 6, 8, 11, 15, 18, 19, 20, 21, 24, 26, 29, 33, 35, 45, 47, 51, 54, 55, 56, 57, 59, 60, 61, 62, 63, 65, 69, 72, 73, 74, 75, 78, 80, 83, 87, 89, 99, 101, 105, 107, 135, 137, 141, 143, 153, 155, 159, 162, 163, 164, 165, 167, 168, 169, 170, 171, 173, 177, 179
Offset: 1

Author

Clark Kimberling, Mar 11 2024

Keywords

Examples

			The ternary representation of 20 is 202, for which c(0)=1 >= c(1)=0 <= c(2)=2.
		

Programs

  • Mathematica
    Select[Range[1000], DigitCount[#, 3, 0] >= DigitCount[#, 3, 1] <= DigitCount[#, 3, 2] &]

A370871 Numbers m such that c(0) >= c(1) > c(2), where c(k) = number of k's in the ternary representation of m.

Original entry on oeis.org

3, 9, 27, 28, 30, 36, 81, 82, 84, 86, 88, 90, 92, 96, 100, 102, 108, 110, 114, 126, 136, 138, 144, 166, 172, 174, 190, 192, 198, 243, 244, 246, 247, 248, 250, 252, 253, 254, 255, 258, 262, 264, 270, 271, 272, 273, 276, 279, 288, 298, 300, 306, 324, 325, 326
Offset: 1

Author

Clark Kimberling, Mar 11 2024

Keywords

Examples

			The ternary representation of 84 is 10010, for which c(0)=3 >= c(1)=2 > c(2)=0.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[1000], DigitCount[#, 3, 0] >= DigitCount[#, 3, 1] > DigitCount[#, 3, 2] &]
Previous Showing 21-30 of 39 results. Next