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

A360413 Irregular table T(n, k), n >= 0, k = 1..A002487(n+1), read by rows; the n-th row lists the numbers k such that A065361(k) = n.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 9, 7, 10, 8, 11, 12, 13, 14, 15, 18, 27, 16, 19, 28, 17, 20, 21, 29, 30, 22, 31, 23, 24, 32, 33, 36, 25, 34, 37, 26, 35, 38, 39, 40, 41, 42, 45, 54, 81, 43, 46, 55, 82, 44, 47, 48, 56, 57, 83, 84, 49, 58, 85, 50, 51, 59, 60, 63, 86, 87, 90
Offset: 0

Views

Author

Rémy Sigrist, Feb 06 2023

Keywords

Comments

As a flat sequence, this is a permutation of the nonnegative integers with inverse A360414.

Examples

			Table T(n, k) begins:
  n   n-th row
  --  ------------------
   0  0
   1  1
   2  2, 3
   3  4
   4  5, 6, 9
   5  7, 10
   6  8, 11, 12
   7  13
   8  14, 15, 18, 27
   9  16, 19, 28
  10  17, 20, 21, 29, 30
  11  22, 31
  12  23, 24, 32, 33, 36
.
Table T(n, k) begins (with terms given in base 3):
  n   n-th row in base 3
  --  -------------------------
   0  0
   1  1
   2  2, 10
   3  11
   4  12, 20, 100
   5  21, 101
   6  22, 102, 110
   7  111
   8  112, 120, 200, 1000
   9  121, 201, 1001
  10  122, 202, 210, 1002, 1010
  11  211, 1011
  12  212, 220, 1012, 1020, 1100
		

Crossrefs

Programs

  • PARI
    See Links section.

Formula

T(n, 1) = A032924(n) for any n > 0.
T(n, A002487(n+1)) = A005836(n+1).
A065361(T(n, k)) = n.

A360415 a(n) is the greatest number k not yet in the sequence such that A065361(n) = A065361(k).

Original entry on oeis.org

0, 1, 3, 2, 4, 9, 6, 10, 12, 5, 7, 11, 8, 13, 27, 18, 28, 30, 15, 19, 29, 21, 31, 36, 33, 37, 39, 14, 16, 20, 17, 22, 32, 24, 34, 38, 23, 25, 35, 26, 40, 81, 54, 82, 84, 45, 55, 83, 57, 85, 90, 87, 91, 93, 42, 46, 56, 48, 58, 86, 63, 88, 92, 60, 64, 89, 66, 94
Offset: 0

Views

Author

Rémy Sigrist, Feb 06 2023

Keywords

Comments

This sequence is a self-inverse permutation of the nonnegative integers.

Examples

			There are four numbers k such that A065361(k) = 8: 14, 15, 18, 27,
- so a(14) = 27,
     a(15) = 18,
     a(18) = 15,
     a(27) = 14.
		

Crossrefs

See A360434 for a similar sequence.

Programs

  • PARI
    See Links section.

Formula

a(A360413(n, k)) = A360413(n, A002487(n) + 1 - k).
a(A032924(n)) = A005836(n+1) for any n > 0.
a(A005836(n+1)) = A032924(n) for any n > 0.

A005836 Numbers whose base-3 representation contains no 2.

Original entry on oeis.org

0, 1, 3, 4, 9, 10, 12, 13, 27, 28, 30, 31, 36, 37, 39, 40, 81, 82, 84, 85, 90, 91, 93, 94, 108, 109, 111, 112, 117, 118, 120, 121, 243, 244, 246, 247, 252, 253, 255, 256, 270, 271, 273, 274, 279, 280, 282, 283, 324, 325, 327, 328, 333, 334, 336, 337, 351, 352
Offset: 1

Views

Author

Keywords

Comments

3 does not divide binomial(2s, s) if and only if s is a member of this sequence, where binomial(2s, s) = A000984(s) are the central binomial coefficients.
This is the lexicographically earliest increasing sequence of nonnegative numbers that contains no arithmetic progression of length 3. - Robert Craigen (craigenr(AT)cc.umanitoba.ca), Jan 29 2001
In the notation of A185256 this is the Stanley Sequence S(0,1). - N. J. A. Sloane, Mar 19 2010
Complement of A074940. - Reinhard Zumkeller, Mar 23 2003
Sums of distinct powers of 3. - Ralf Stephan, Apr 27 2003
Numbers n such that central trinomial coefficient A002426(n) == 1 (mod 3). - Emeric Deutsch and Bruce E. Sagan, Dec 04 2003
A039966(a(n)+1) = 1; A104406(n) = number of terms <= n.
Subsequence of A125292; A125291(a(n)) = 1 for n>1. - Reinhard Zumkeller, Nov 26 2006
Also final value of n - 1 written in base 2 and then read in base 3 and with finally the result translated in base 10. - Philippe LALLOUET (philip.lallouet(AT)wanadoo.fr), Jun 23 2007
a(n) modulo 2 is the Thue-Morse sequence A010060. - Dennis Tseng, Jul 16 2009
Also numbers such that the balanced ternary representation is the same as the base 3 representation. - Alonso del Arte, Feb 25 2011
Fixed point of the morphism: 0 -> 01; 1 -> 34; 2 -> 67; ...; n -> (3n)(3n+1), starting from a(1) = 0. - Philippe Deléham, Oct 22 2011
It appears that this sequence lists the values of n which satisfy the condition sum(binomial(n, k)^(2*j), k = 0..n) mod 3 <> 0, for any j, with offset 0. See Maple code. - Gary Detlefs, Nov 28 2011
Also, it follows from the above comment by Philippe Lallouet that the sequence must be generated by the rules: a(1) = 0, and if m is in the sequence then so are 3*m and 3*m + 1. - L. Edson Jeffery, Nov 20 2015
Add 1 to each term and we get A003278. - N. J. A. Sloane, Dec 01 2019

Examples

			12 is a term because 12 = 110_3.
This sequence regarded as a triangle with rows of lengths 1, 1, 2, 4, 8, 16, ...:
   0
   1
   3,  4
   9, 10, 12, 13
  27, 28, 30, 31, 36, 37, 39, 40
  81, 82, 84, 85, 90, 91, 93, 94, 108, 109, 111, 112, 117, 118, 120, 121
... - _Philippe Deléham_, Jun 06 2015
		

References

  • Richard K. Guy, Unsolved Problems in Number Theory, 3rd Edition, Springer, 2004, Section E10, pp. 317-323.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A039966 (characteristic function).
For generating functions Product_{k>=0} (1+a*x^(b^k)) for the following values of (a,b) see: (1,2) A000012 and A000027, (1,3) A039966 and A005836, (1,4) A151666 and A000695, (1,5) A151667 and A033042, (2,2) A001316, (2,3) A151668, (2,4) A151669, (2,5) A151670, (3,2) A048883, (3,3) A117940, (3,4) A151665, (3,5) A151671, (4,2) A102376, (4,3) A151672, (4,4) A151673, (4,5) A151674.
Row 3 of array A104257.
Summary of increasing sequences avoiding arithmetic progressions of specified lengths (the second of each pair is obtained by adding 1 to the first):
3-term AP: A005836 (>=0), A003278 (>0);
4-term AP: A005839 (>=0), A005837 (>0);
5-term AP: A020654 (>=0), A020655 (>0);
6-term AP: A020656 (>=0), A005838 (>0);
7-term AP: A020657 (>=0), A020658 (>0);
8-term AP: A020659 (>=0), A020660 (>0);
9-term AP: A020661 (>=0), A020662 (>0);
10-term AP: A020663 (>=0), A020664 (>0).
See also A000452.

Programs

  • Haskell
    a005836 n = a005836_list !! (n-1)
    a005836_list = filter ((== 1) . a039966) [0..]
    -- Reinhard Zumkeller, Jun 09 2012, Sep 29 2011
    
  • Julia
    function a(n)
        m, r, b = n, 0, 1
        while m > 0
            m, q = divrem(m, 2)
            r += b * q
            b *= 3
        end
    r end; [a(n) for n in 0:57] |> println # Peter Luschny, Jan 03 2021
  • Maple
    t := (j, n) -> add(binomial(n,k)^j, k=0..n):
    for i from 1 to 400 do
        if(t(4,i) mod 3 <>0) then print(i) fi
    od; # Gary Detlefs, Nov 28 2011
    # alternative Maple program:
    a:= proc(n) option remember: local k, m:
    if n=1 then 0 elif n=2 then 1 elif n>2 then k:=floor(log[2](n-1)): m:=n-2^k: procname(m)+3^k: fi: end proc:
    seq(a(n), n=1.. 20); # Paul Weisenhorn, Mar 22 2020
    # third Maple program:
    a:= n-> `if`(n=1, 0, irem(n-1, 2, 'q')+3*a(q+1)):
    seq(a(n), n=1..100);  # Alois P. Heinz, Jan 26 2022
  • Mathematica
    Table[FromDigits[IntegerDigits[k, 2], 3], {k, 60}]
    Select[Range[0, 400], DigitCount[#, 3, 2] == 0 &] (* Harvey P. Dale, Jan 04 2012 *)
    Join[{0}, Accumulate[Table[(3^IntegerExponent[n, 2] + 1)/2, {n, 57}]]] (* IWABUCHI Yu(u)ki, Aug 01 2012 *)
    FromDigits[#,3]&/@Tuples[{0,1},7] (* Harvey P. Dale, May 10 2019 *)
  • PARI
    A=vector(100);for(n=2,#A,A[n]=if(n%2,3*A[n\2+1],A[n-1]+1));A \\ Charles R Greathouse IV, Jul 24 2012
    
  • PARI
    is(n)=while(n,if(n%3>1,return(0));n\=3);1 \\ Charles R Greathouse IV, Mar 07 2013
    
  • PARI
    a(n) = fromdigits(binary(n-1),3);  \\ Gheorghe Coserea, Jun 15 2018
    
  • Python
    def A005836(n):
        return int(format(n-1,'b'),3) # Chai Wah Wu, Jan 04 2015
    

Formula

a(n) = A005823(n)/2 = A003278(n)-1 = A033159(n)-2 = A033162(n)-3.
Numbers n such that the coefficient of x^n is > 0 in prod (k >= 0, 1 + x^(3^k)). - Benoit Cloitre, Jul 29 2003
a(n+1) = Sum_{k=0..m} b(k)* 3^k and n = Sum( b(k)* 2^k ).
a(2n+1) = 3a(n+1), a(2n+2) = a(2n+1) + 1, a(0) = 0.
a(n+1) = 3*a(floor(n/2)) + n - 2*floor(n/2). - Ralf Stephan, Apr 27 2003
G.f.: (x/(1-x)) * Sum_{k>=0} 3^k*x^2^k/(1+x^2^k). - Ralf Stephan, Apr 27 2003
a(n) = Sum_{k = 1..n-1} (1 + 3^A007814(k)) / 2. - Philippe Deléham, Jul 09 2005
From Reinhard Zumkeller, Mar 02 2008: (Start)
A081603(a(n)) = 0.
If the offset were changed to zero, then: a(0) = 0, a(n+1) = f(a(n)+1, a(n)+1) where f(x, y) = if x < 3 and x <> 2 then y else if x mod 3 = 2 then f(y+1, y+1) else f(floor(x/3), y). (End)
With offset a(0) = 0: a(n) = Sum_{k>=0} A030308(n,k)*3^k. - Philippe Deléham, Oct 15 2011
a(2^n) = A003462(n). - Philippe Deléham, Jun 06 2015
We have liminf_{n->infinity} a(n)/n^(log(3)/log(2)) = 1/2 and limsup_{n->infinity} a(n)/n^(log(3)/log(2)) = 1. - Gheorghe Coserea, Sep 13 2015
a(2^k+m) = a(m) + 3^k with 1 <= m <= 2^k and 1 <= k, a(1)=0, a(2)=1. - Paul Weisenhorn, Mar 22 2020
Sum_{n>=2} 1/a(n) = 2.682853110966175430853916904584699374821677091415714815171756609672281184705... (calculated using Baillie and Schmelzer's kempnerSums.nb, see Links). - Amiram Eldar, Feb 12 2022
A065361(a(n)) = n-1. - Rémy Sigrist, Feb 06 2023
a(n) ≍ n^k, where k = log 3/log 2 = 1.5849625007. (I believe the constant varies from 1/2 to 1.) - Charles R Greathouse IV, Mar 29 2024

Extensions

Offset corrected by N. J. A. Sloane, Mar 02 2008
Edited by the Associate Editors of the OEIS, Apr 07 2009

A065720 Primes whose binary representation is also the decimal representation of a prime.

Original entry on oeis.org

3, 5, 23, 47, 89, 101, 149, 157, 163, 173, 179, 199, 229, 313, 331, 367, 379, 383, 443, 457, 523, 587, 631, 643, 647, 653, 659, 709, 883, 947, 997, 1009, 1091, 1097, 1163, 1259, 1277, 1283, 1289, 1321, 1483, 1601, 1669, 1693, 1709, 1753, 1877, 2063, 2069, 2099
Offset: 1

Views

Author

Patrick De Geest, Nov 15 2001

Keywords

Comments

In general rebase notation (Marc LeBrun): p2 = (2) [p] (10).
Also: Primes in A036952. - M. F. Hasler, Dec 11 2012
See A089971 for the binary representation of these terms. - M. F. Hasler, Jan 05 2014

Examples

			1009{10} = 1111110001{2} is prime, and 1111110001{10} is also prime.
89 is in the sequence because it is a prime. Binary representation of 89 = 1011001, which is also a prime.
		

Crossrefs

Programs

  • Maple
    select(t -> isprime(t) and isprime(convert(t,binary)),[seq(2*i+1,i=1..1000)]); # Robert Israel, Jul 08 2014
  • Mathematica
    Select[ Range[1900], PrimeQ[ # ] && PrimeQ[ FromDigits[ IntegerDigits[ #, 2]]] & ]
    Select[ Prime@ Range@ 330, PrimeQ[ FromDigits[ IntegerDigits[#, 2]]] &] (* Robert G. Wilson v, Oct 09 2014 *)
  • PARI
    isok(p) = isprime(p) && isprime(fromdigits(binary(p), 10)); \\ Michel Marcus, Mar 04 2022
    
  • Python
    from sympy import isprime
    def ok(n): return isprime(n) and isprime(int(bin(n)[2:]))
    print([k for k in range(2100) if ok(k)]) # Michael S. Branicky, Mar 04 2022

Formula

Equals A036952 intersect A000040. - M. F. Hasler, Dec 11 2012

Extensions

a(48)-a(50) from K. D. Bajpai, Jul 04 2014

A065727 Primes p such that the decimal expansion of its base-9 conversion is also prime.

Original entry on oeis.org

2, 3, 5, 7, 37, 43, 61, 109, 127, 199, 271, 277, 379, 457, 487, 523, 541, 613, 619, 673, 727, 757, 883, 907, 919, 991, 997, 1033, 1117, 1249, 1447, 1483, 1531, 1549, 1567, 1627, 1693, 1699, 1747, 1753, 1987, 2053, 2161, 2221, 2287, 2341, 2347, 2437, 2473
Offset: 1

Views

Author

Patrick De Geest, Nov 15 2001

Keywords

Comments

In general rebase notation (Marc LeBrun): p9 = (9) [p] (10).

Examples

			E.g., 997_10 = 1327_9 is prime, and so is 1327_10.
		

Crossrefs

Programs

  • Mathematica
    Select[ Range[2500], PrimeQ[ # ] && PrimeQ[ FromDigits[ IntegerDigits[ #, 9]]] & ]
    NestList[NestWhile[NextPrime, #, ! PrimeQ[FromDigits[IntegerDigits[#2, 9]]] &, 2] &, 2, 48] (* Jan Mangaldan, Jul 01 2020 *)
    Select[Prime[Range[400]],PrimeQ[FromDigits[IntegerDigits[#,9],10]]&] (* Harvey P. Dale, Sep 19 2021 *)
  • PARI
    isok(p) = isprime(p) && isprime(fromdigits(digits(p, 9))); \\ Michel Marcus, Jul 02 2020

A235265 Primes whose base-3 representation also is the base-2 representation of a prime.

Original entry on oeis.org

3, 13, 31, 37, 271, 283, 733, 757, 769, 1009, 1093, 2281, 2467, 2521, 2551, 2917, 3001, 3037, 3163, 3169, 3187, 3271, 6673, 7321, 7573, 9001, 9103, 9733, 19801, 19963, 20011, 20443, 20521, 20533, 20749, 21871, 21961, 22123, 22639, 22717, 27253, 28711, 28759, 29173, 29191, 59077, 61483, 61507, 61561, 65701, 65881
Offset: 1

Views

Author

M. F. Hasler, Jan 05 2014

Keywords

Comments

This sequence and A235383 and A229037 are winners in the contest held at the 2014 AMS/MAA Joint Mathematics Meetings. - T. D. Noe, Jan 20 2014
This sequence was motivated by work initiated by V.J. Pohjola's post to the SeqFan list, which led to a clarification of the definition and correction of some errors, in sequences A089971, A089981 and A090707 through A090721. These sequences use "rebasing" (terminology of A065361) from some base b to base 10. Sequences A065720 - A065727 follow the same idea but use rebasing in the other sense, from base 10 to base b. The observation that only (10,b) and (b,10) had been considered so far led to the definition of this and related sequences: In a systematic approach, it seems natural to start with the smallest possible pairs of different bases, (2,3) and (3,2), then (2 <-> 4), (3 <-> 4), (2 <-> 5), etc.
Among the two possibilities using the smallest possible bases, 2 and 3, the present one seems a little bit more interesting, among others because not every base-3 representation is a valid base-2 representation (in contrast to the opposite case). This is also a reason why the present sequence grows much faster than the partner sequence A235266.

Examples

			3 = 10_3 and 10_2 = 2 is prime. 13 = 111_3 and 111_2 = 7 is prime.
		

Crossrefs

Subset of A077717.
Cf. A235266, A065720 and A036952, A065721 - A065727, A235394, A235395, A089971 and A020449, A089981, A090707 - A091924, A235461 - A235482. See M. F. Hasler's OEIS wiki page for further cross-references.

Programs

  • Maple
    N:= 1000: # to get the first N terms
    count:= 0:
    for i from 1 while count < N do
       p2:= ithprime(i);
       L:= convert(p2,base,2);
       p3:= add(3^(j-1)*L[j],j=1..nops(L));
       if isprime(p3) then
          count:= count+1;
          A235265[count]:= p3;
       fi
    od:
    [seq(A235265[i], i=1..N)]; # Robert Israel, May 04 2014
  • Mathematica
    b32pQ[n_]:=Module[{idn3=IntegerDigits[n,3]},Max[idn3]<2&&PrimeQ[ FromDigits[ idn3,2]]]; Select[Prime[Range[7000]],b32pQ] (* Harvey P. Dale, Apr 24 2015 *)
  • PARI
    is(p,b=2,c=3)=vecmax(d=digits(p,c))
    				
  • Python
    from sympy import isprime, nextprime
    def agen(): # generator of terms
        p = 2
        while True:
            p3 = sum(3**i for i, bi in enumerate(bin(p)[2:][::-1]) if bi=='1')
            if isprime(p3):
                yield p3
            p = nextprime(p)
    g = agen()
    print([next(g) for n in range(1, 52)]) # Michael S. Branicky, Jan 16 2022

A032924 Numbers whose ternary expansion contains no 0.

Original entry on oeis.org

1, 2, 4, 5, 7, 8, 13, 14, 16, 17, 22, 23, 25, 26, 40, 41, 43, 44, 49, 50, 52, 53, 67, 68, 70, 71, 76, 77, 79, 80, 121, 122, 124, 125, 130, 131, 133, 134, 148, 149, 151, 152, 157, 158, 160, 161, 202, 203, 205, 206, 211, 212, 214, 215, 229, 230, 232, 233, 238, 239
Offset: 1

Views

Author

Keywords

Comments

Complement of A081605. - Reinhard Zumkeller, Mar 23 2003
Subsequence of A154314. - Reinhard Zumkeller, Jan 07 2009
The first 28 terms are the range of A059852 (Morse codes for letters, when written in base 3) union {44, 50} (which correspond to Morse codes of Ü and Ä). Subsequent terms represent the Morse code of other symbols in the same coding. - M. F. Hasler, Jun 22 2020

Crossrefs

Zeroless numbers in some other bases <= 10: A000042 (base 2), A023705 (base 4), A248910 (base 6), A255805 (base 8), A255808 (base 9), A052382 (base 10).

Programs

  • Haskell
    a032924 n = a032924_list !! (n-1)
    a032924_list = iterate f 1 where
       f x = 1 + if r < 2 then x else 3 * f x'  where (x', r) = divMod x 3
    -- Reinhard Zumkeller, Mar 07 2015, May 04 2012
    
  • Maple
    f:= proc(n) local L,i,m;
       L:= convert(n,base,2);
       m:= nops(L);
       add((1+L[i])*3^(i-1),i=1..m-1);
    end proc:
    map(f, [$2..101]); # Robert Israel, Aug 04 2015
  • Mathematica
    Select[Range@ 240, Last@ DigitCount[#, 3] == 0 &] (* Michael De Vlieger, Aug 05 2015 *)
    Flatten[Table[FromDigits[#,3]&/@Tuples[{1,2},n],{n,5}]] (* Harvey P. Dale, May 28 2016 *)
  • PARI
    apply( {A032924(n)=if(n<3,n,3*self()((n-1)\2)+2-n%2)}, [1..99]) \\ M. F. Hasler, Jun 22 2020
    
  • PARI
    a(n) = fromdigits(apply(d->d+1,binary(n+1)[^1]), 3); \\ Kevin Ryde, Jun 23 2020
    
  • Python
    def a(n): return sum(3**i*(int(b)+1) for i, b in enumerate(bin(n+1)[:2:-1]))
    print([a(n) for n in range(1, 61)]) # Michael S. Branicky, Aug 15 2022
    
  • Python
    def is_A032924(n):
        while n > 2:
           n,r = divmod(n,3)
           if r==0: return False
        return n > 0
    print([n for n in range(250) if is_A032924(n)]) # M. F. Hasler, Feb 15 2023
    
  • Python
    def A032924(n): return int(bin(m:=n+1)[3:],3) + (3**(m.bit_length()-1)-1>>1) # Chai Wah Wu, Oct 13 2023

Formula

a(n) = A107680(n) + A107681(n). - Reinhard Zumkeller, May 20 2005
A081604(A107681(n)) <= A081604(A107680(n)) = A081604(a(n)) = A000523(n+1). - Reinhard Zumkeller, May 20 2005
A077267(a(n)) = 0. - Reinhard Zumkeller, Mar 02 2008
a(1)=1, a(n+1) = f(a(n)+1,a(n)+1) where f(x,y) = if x<3 and x<>0 then y, else if x mod 3 = 0 then f(y+1,y+1), else f(floor(x/3),y). - Reinhard Zumkeller, Mar 02 2008
a(2*n) = a(2*n-1)+1, n>0. - Zak Seidov, Jul 27 2009
A212193(a(n)) = 0. - Reinhard Zumkeller, May 04 2012
a(2*n+1) = 3*a(n)+1. - Robert Israel, Aug 05 2015
G.f.: x/(1-x)^2 + Sum_{m >= 1} 3^(m-1)*x^(2^(m+1)-1)/((1-x^(2^m))*(1-x)). - Robert Israel, Aug 04 2015
A065361(a(n)) = n. - Rémy Sigrist, Feb 06 2023
Sum_{n>=1} 1/a(n) = 3.4977362637842652509313189236131190039368413460747606236619907531632476445332666030262441154353753276457... (calculated using Baillie and Schmelzer's kempnerSums.nb, see Links). - Amiram Eldar, Apr 14 2025

A065721 Primes p whose base-3 expansion is also the decimal expansion of a prime.

Original entry on oeis.org

2, 67, 79, 103, 139, 157, 181, 193, 199, 211, 229, 277, 283, 307, 313, 349, 367, 373, 409, 421, 433, 439, 463, 523, 541, 547, 571, 577, 751, 829, 883, 919, 1021, 1033, 1039, 1087, 1171, 1249, 1303, 1429, 1483, 1579, 1597, 1621, 1741, 1783, 1789, 1873
Offset: 1

Views

Author

Patrick De Geest, Nov 15 2001

Keywords

Comments

In general rebase notation (Marc LeBrun): p3 = (3) [p] (10).

Examples

			1033_10 = 1102021_3 is prime, and so is 1102021_10.
		

Crossrefs

Primes in A036954.
Cf. A065720 up to A065727, A065361. See the Links for further cross-references.

Programs

  • Mathematica
    Select[ Range[1900], PrimeQ[ # ] && PrimeQ[ FromDigits[ IntegerDigits[ #, 3]]] & ]
  • PARI
    is(p,b=10,c=3)=isprime(vector(#c=digits(p,c),i,b^(#c-i))*c~)&&isprime(p) \\ M. F. Hasler, Jan 12 2014

Extensions

Definition clarified by M. F. Hasler, Jan 12 2014

A065722 Primes that when written in base 4, then reinterpreted in base 10, again give primes.

Original entry on oeis.org

2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 37, 43, 47, 53, 61, 71, 73, 79, 83, 97, 103, 107, 109, 113, 131, 149, 151, 157, 163, 167, 181, 191, 193, 197, 227, 233, 241, 251, 277, 293, 307, 311, 313, 317, 349, 359, 373, 389, 401, 419, 421, 433, 443, 449, 463, 467, 503
Offset: 1

Views

Author

Patrick De Geest, Nov 15 2001

Keywords

Comments

In general rebase notation (Marc LeBrun): p4 = (4) [p] (10).

Examples

			The decimal prime 29 in base 4 is 131 which is again a prime in base 10.
E.g., 509_10 = 13331_4 is prime but also 13331_10.
		

Crossrefs

Programs

  • Maple
    A007090 := proc(n) local b4digs ; b4digs := convert(n,base,4) ; add( op(i,b4digs)*10^(i-1),i=1..nops(b4digs)) ; end: isA065722 := proc(n) local rebase ; if isprime(n) then rebase := A007090(n) ; RETURN(isprime(rebase)) ; else RETURN(false) ; fi ; end: for n from 1 to 1000 do p := ithprime(n) : if isA065722(p) then printf("%d, ",p) ; fi : od : # R. J. Mathar, Jun 15 2007
  • Mathematica
    Select[ Range[505], PrimeQ[ # ] && PrimeQ[ FromDigits[ IntegerDigits[ #, 4]]] & ]
  • PARI
    isok(p)={ isprime(p) && isprime(fromdigits(digits(p,4))) } \\ Harry J. Smith, Oct 27 2009

Formula

Numbers n such that A049084(n)>0 and A049084(A007090(n))>0. - R. J. Mathar, Jun 15 2007

Extensions

Edited by N. J. A. Sloane, Jul 02 2008 at the suggestion of R. J. Mathar

A065723 Primes that when written in base 5, then reinterpreted in base 10, again give primes.

Original entry on oeis.org

2, 3, 13, 23, 41, 71, 83, 101, 163, 191, 211, 281, 283, 311, 331, 463, 503, 571, 613, 653, 701, 743, 823, 863, 881, 983, 1091, 1213, 1231, 1283, 1301, 1373, 1381, 1423, 1471, 1493, 1531, 1543, 1621, 1741, 1783, 1861, 1873, 1931, 2063, 2203, 2213, 2221
Offset: 1

Views

Author

Patrick De Geest, Nov 15 2001

Keywords

Comments

In general rebase notation (Marc LeBrun): p5 = (5) [p] (10).

Examples

			E.g., 2213_10 = 32323_5 is prime, and so is 32323_10.
		

Crossrefs

Cf. A065720 up to A065727, A065361.

Programs

  • Mathematica
    Select[ Range[2250], PrimeQ[ # ] && PrimeQ[ FromDigits[ IntegerDigits[ #, 5]]] & ]
    Select[Prime[Range[400]],PrimeQ[FromDigits[IntegerDigits[#,5]]]&] (* Harvey P. Dale, Mar 28 2015 *)
  • PARI
    isok(p)={ isprime(p) && isprime(fromdigits(digits(p,5))) } \\ Harry J. Smith, Oct 27 2009
Showing 1-10 of 18 results. Next