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 11-15 of 15 results.

A208665 Numbers that match odd ternary polynomials; see Comments.

Original entry on oeis.org

3, 6, 27, 30, 33, 54, 57, 60, 243, 246, 249, 270, 273, 276, 297, 300, 303, 486, 489, 492, 513, 516, 519, 540, 543, 546, 2187, 2190, 2193, 2214, 2217, 2220, 2241, 2244, 2247, 2430, 2433, 2436, 2457, 2460, 2463, 2484, 2487, 2490, 2673, 2676, 2679
Offset: 1

Views

Author

Clark Kimberling, Feb 29 2012

Keywords

Comments

The ternary polynomials (having all coefficients in {0,1,2}) are enumerated at A207966. This sequence shows the numbers n for which p(n,-x)=-p(n,x).

Crossrefs

Cf. A037314, A207966, A338086 (ternary digit duplication).

Programs

  • Mathematica
    t = Table[IntegerDigits[n, 3], {n, 1, 4000}];
    b[n_] := Reverse[Table[x^k, {k, 0, n}]]
    p[n_, x_] := t[[n]].b[-1 + Length[t[[n]]]]
    Table[p[n, x], {n, 1, 30}]
    even = {}; Do[n++; If[(p[n, x] /. x -> -x) == p[n, x], AppendTo[even, n]], {n, 1600}];
    even     (* A037314 for n >= 2 *)
    odd = {}; Do[n++; If[(p[n, x] /. x -> -x) == -p[n, x], AppendTo[odd, n]], {n, 3900}];
    odd      (* A208665 *)
  • PARI
    a(n) = 3*fromdigits(digits(n,3),9); \\ Kevin Ryde, Oct 17 2020

A163330 Square array A, where entry A(y,x) has the ternary digits of y interleaved with the ternary digits of x, converted back to decimal. Listed by antidiagonals: A(0,0), A(0,1), A(1,0), A(0,2), A(1,1), A(2,0), ...

Original entry on oeis.org

0, 3, 1, 6, 4, 2, 27, 7, 5, 9, 30, 28, 8, 12, 10, 33, 31, 29, 15, 13, 11, 54, 34, 32, 36, 16, 14, 18, 57, 55, 35, 39, 37, 17, 21, 19, 60, 58, 56, 42, 40, 38, 24, 22, 20, 243, 61, 59, 63, 43, 41, 45, 25, 23, 81, 246, 244, 62, 66, 64, 44, 48, 46, 26, 84, 82, 249, 247, 245
Offset: 0

Views

Author

Antti Karttunen, Jul 29 2009

Keywords

Crossrefs

Inverse: A163331. a(n) = A163327(A163328(n)). Transpose: A163328. Cf. A007089, A163327, A163332, A163334.

Programs

Formula

a(n) = 3*A037314(A025581(n)) + A037314(A002262(n))

A163480 Row 0 of A163334 (column 0 of A163336).

Original entry on oeis.org

0, 1, 2, 15, 16, 17, 18, 19, 20, 141, 142, 143, 144, 145, 146, 159, 160, 161, 162, 163, 164, 177, 178, 179, 180, 181, 182, 1275, 1276, 1277, 1278, 1279, 1280, 1293, 1294, 1295, 1296, 1297, 1298, 1311, 1312, 1313, 1314, 1315, 1316, 1437, 1438, 1439
Offset: 0

Views

Author

Antti Karttunen, Jul 29 2009

Keywords

Crossrefs

Cf. A163481 (Y axis), A037314 (Z-order X axis).
Coordinates: A163528, A163529.

Programs

  • PARI
    a(n) = my(v=digits(n,3),s=Mod(0,2)); for(i=1,#v, if(s,v[i]+=6); s+=v[i]); fromdigits(v,9); \\ Kevin Ryde, Sep 29 2020

Formula

a(n) = A163332(A037314(n)). - Kevin Ryde, Sep 29 2020

A235472 Primes whose base-9 representation also is the base-3 representation of a prime.

Original entry on oeis.org

2, 11, 19, 83, 101, 163, 173, 739, 811, 821, 829, 911, 1549, 1559, 1621, 6563, 6581, 6661, 6733, 8111, 8191, 13933, 14753, 59069, 59141, 59779, 59797, 59951, 60589, 60607, 65629, 65701, 66359, 67079, 67231, 72271, 72353, 72901, 118189, 119557, 119657, 124669, 124823, 125399
Offset: 1

Views

Author

M. F. Hasler, Jan 12 2014

Keywords

Comments

This sequence is part of the two-dimensional array of sequences based on this same idea for any two different bases b, c > 1. Sequence A235265 and A235266 are the most elementary ones in this list. Sequences A089971, A089981 and A090707 through A090721, and sequences A065720 - A065727, follow the same idea with one base equal to 10.
For further motivation and cross-references, see sequence A235265 which is the main entry for this whole family of sequences.
Since all digits of the base 9 expansion are less than 3, this is a subsequence of A037314.

Examples

			Both 17 = 21_9 and 21_3 = 7 are prime.
		

Crossrefs

Cf. A065720A036952, A065721 - A065727, A235394, A235395, A089971A020449, A089981, A090707 - A091924, A235461 - A235482. See the LINK for further cross-references.

Programs

  • PARI
    is(p,b=3,c=9)=vecmax(d=digits(p,c))
    				
  • PARI
    forprime(p=1,2e3,is(p,9,3)&&print1(vector(#d=digits(p,3),i,9^(#d-i))*d~,",")) \\ To produce the terms, this is more efficient than to select them using straightforwardly is(.)=is(.,3,9)

A261691 Change of base from fractional base 3/2 to base 3.

Original entry on oeis.org

0, 1, 2, 6, 7, 8, 21, 22, 23, 63, 64, 65, 69, 70, 71, 192, 193, 194, 207, 208, 209, 213, 214, 215, 579, 580, 581, 621, 622, 623, 627, 628, 629, 642, 643, 644, 1737, 1738, 1739, 1743, 1744, 1745, 1866, 1867, 1868, 1881, 1882, 1883, 1887, 1888, 1889, 1929, 1930
Offset: 0

Views

Author

Tom Edgar, Aug 28 2015

Keywords

Comments

To obtain a(n), we interpret A024629(n) as a base 3 representation (instead of base 3/2). More precisely, if A024629(n) = A007089(m), then a(n) = m.
The digits used in fractional base 3/2 are 0, 1, and 2, which are the same as the digits used in base 3.

Examples

			The base 3/2 representation of 7 is (2,1,1); i.e., 7 = 2*(3/2)^2 + 1*(3/2) + 1. Since 2*(3^2) + 1*3 + 1*1 = 22, we have a(7) = 22.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := a[n] = If[n == 0, 0, 3 * a[2 * Floor[n/3]] + Mod[n, 3]]; Array[a, 100, 0] (* Amiram Eldar, Aug 04 2025 *)
  • PARI
    a(n) = { my (v=0, t=1); while (n, v+=t*(n%3); n=(n\3)*2; t*=3); v } \\ Rémy Sigrist, Apr 06 2021
  • Sage
    def changebase(n):
        L=[n]
        i=1
        while L[i-1]>2:
            x=L[i-1]
            L[i-1]=x.mod(3)
            L.append(2*floor(x/3))
            i+=1
        return sum([L[i]*3^i for i in [0..len(L)-1]])
    [changebase(n) for n in [0..100]]
    

Formula

For n = Sum_{i=0..m} c_i*(3/2)^i with each c_i in {0,1,2}, a(n) = Sum_{i=0..m} c_i*3^i.
From Rémy Sigrist, Apr 06 2021: (Start)
Apparently:
- a(3*n) = a(3*n-1) + A003462(1+A087088(n)) for any n > 0,
- a(3*n+1) = a(3*n) + 1 for any n >= 0,
- a(3*n+2) = a(3*n+1) + 1 for any n >= 0,
(End)
Previous Showing 11-15 of 15 results.