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-2 of 2 results.

A007090 Numbers in base 4.

Original entry on oeis.org

0, 1, 2, 3, 10, 11, 12, 13, 20, 21, 22, 23, 30, 31, 32, 33, 100, 101, 102, 103, 110, 111, 112, 113, 120, 121, 122, 123, 130, 131, 132, 133, 200, 201, 202, 203, 210, 211, 212, 213, 220, 221, 222, 223, 230, 231, 232, 233, 300, 301, 302, 303, 310, 311, 312, 313, 320, 321, 322, 323, 330, 331, 332, 333
Offset: 0

Views

Author

Keywords

Comments

Nonnegative integers with no decimal digit > 3. Thus nonnegative integers in base 10 whose tripling (trebling) by normal addition or multiplication requires no carry operation. - Rick L. Shepherd, Jun 25 2009
Interpreted in base 10: a(x)+a(y) = a(z) => x+y = z. The converse is not true in general. - Karol Bacik, Sep 27 2012

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A007608, A000042, A007088 (base 2), A007089 (base 3), A007091 (base 5), A007092 (base 6), A007093 (base 7), A007094 (base 8), A007095 (base 9), A193890, A107715.

Programs

  • Haskell
    a007090 0 = 0
    a007090 n = 10 * a007090 n' + m where (n', m) = divMod n 4
    -- Reinhard Zumkeller, Apr 08 2013, Aug 11 2011
  • Maple
    A007090 := proc(n) local l: if(n=0)then return 0: fi: l:=convert(n,base,4): return op(convert(l,base,10,10^nops(l))): end: seq(A007090(n),n=0..54); # Nathaniel Johnston, May 06 2011
  • Mathematica
    Table[ FromDigits[ IntegerDigits[n, 4]], {n, 0, 60}]
  • PARI
    a(n)=if(n<1,0,if(n%4,a(n-1)+1,10*a(n/4)))
    
  • PARI
    A007090(n)=sum(i=1,#n=digits(n,4),n[i]*10^(#n-i)) \\ M. F. Hasler, Jul 25 2015 (Corrected by Jinyuan Wang, Oct 02 2019)
    
  • PARI
    apply( A007090(n)=fromdigits(digits(n,4)), [0..66]) \\ M. F. Hasler, Nov 18 2019
    

Formula

a(n) = Sum_{d(i)*10^i: i=0, 1, ..., m}, where Sum_{d(i)*4^i: i=0, 1, ..., m} is the base 4 representation of n.
a(0) = 0, a(n) = 10*a(n/4) if n==0 (mod 4), a(n) = a(n-1)+1 otherwise. - Benoit Cloitre, Dec 22 2002

A107715 Primes having only {0,1,2,3} as digits.

Original entry on oeis.org

2, 3, 11, 13, 23, 31, 101, 103, 113, 131, 211, 223, 233, 311, 313, 331, 1013, 1021, 1031, 1033, 1103, 1123, 1201, 1213, 1223, 1231, 1301, 1303, 1321, 2003, 2011, 2111, 2113, 2131, 2203, 2213, 2221, 2311, 2333, 3001, 3011, 3023, 3121, 3203, 3221, 3301, 3313
Offset: 1

Views

Author

Rick L. Shepherd, May 22 2005

Keywords

Crossrefs

Subsequence of A036956.
Cf. A036953 (primes containing digits from set {0, 1, 2}).

Programs

  • Haskell
    a107715 n = a107715_list !! (n-1)
    a107715_list = filter ((== 1) . a010051) a007090_list
    -- Reinhard Zumkeller, Aug 11 2011
    
  • Mathematica
    Select[Prime[Range[500]],Max[IntegerDigits[#]]<4&] (* Harvey P. Dale, May 09 2012 *)
    Select[FromDigits/@Tuples[{0,1,2,3},4],PrimeQ] (* Harvey P. Dale, Mar 06 2016 *)
  • Python
    from gmpy2 import digits
    from sympy import isprime
    [int(digits(n,4)) for n in range(1000) if isprime(int(digits(n,4)))] # Chai Wah Wu, Jul 31 2014
    
  • Python
    print(list(islice(primes_with("0123"), 41))) # uses function/imports in A385776. Jason Bard, Jul 18 2025
Showing 1-2 of 2 results.