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

A276326 Numbers expressed in greedy A001563-base.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Aug 30 2016

Keywords

Comments

Terms A001563(1) = 1, A001563(2) = 4, A001563(3) = 18, ... give the base values for the digit positions from 1 onward. Digit places are filled by always trying to find the largest possible term of A001563 that still fits into the sum.
A130744(8) = 3225600 = 10*A001563(8) is the first number which yields an ambiguous representation when expressed in decimal, because in this base it is actually "A0000000" (where digit "A" stands for ten).

Examples

			To recover n from a(n) the digits in positions i = 1, 2, 3, ... (starting indexing from the least significant digit at right) are multiplied by A001563(i) and added together:
  ----------------
   n         a(n)
  ----------------
   0           0
   1           1
   2           2
   3           3
   4          10
   5          11
   6          12
   7          13
   8          20
   9          21
  10          22
  11          23
  12          30
  13          31
  14          32
  15          33
  16          40
  17          41 (as 4*A001563(2) + 1*A001563(1) = 17)
  18         100 (as 1*A001563(3) + 0*A001563(2) + 0*A001563(1) = 18)
and:
3225599 99111111 (as 3225599 = 9*b(8) + 9*b(7) + b(6) + b(5) + b(4) + b(3) + b(2) + b(1)), where b(n) = A001563(n).
		

Crossrefs

Cf. A276327 (the least significant nonzero digit).
Cf. A276328 (the sum of digits).
Cf. A276333 (the most significant digit).
Cf. A276336 (a largest digit).
Cf. A276337 (number of nonzero digits).
Cf. A033312 (repunits).
Cf. A276091 (no digits larger than one).
Differs from A007090 for the first time at n=16 and from A055655 at n=18.

Programs

  • Mathematica
    f[n_] := Block[{a = {{0, n}}}, Do[AppendTo[a, {First@ #, Last@ #} &@ QuotientRemainder[a[[-1, -1]], (# #!) &[# - i]]], {i, 0, # - 1}] &@ NestWhile[# + 1 &, 0, (# #!) &[# + 1] <= n &]; Rest[a][[All, 1]]]; Table[FromDigits@ f@ n, {n, 72}] (* Michael De Vlieger, Aug 31 2016 *)
  • Scheme
    (define (A276326 n) (let loop ((n n) (s 0)) (if (zero? n) s (let ((dig (A276333 n))) (if (> dig 9) (error "A276326: ambiguous representation of n, digit > 9 would be needed: " n dig) (loop (A276335 n) (+ s (* dig (expt 10 (- (A258198 n) 1))))))))))

A004678 Primes written in base 4.

Original entry on oeis.org

2, 3, 11, 13, 23, 31, 101, 103, 113, 131, 133, 211, 221, 223, 233, 311, 323, 331, 1003, 1013, 1021, 1033, 1103, 1121, 1201, 1211, 1213, 1223, 1231, 1301, 1333, 2003, 2021, 2023, 2111, 2113, 2131, 2203, 2213, 2231, 2303, 2311, 2333, 3001, 3011, 3013
Offset: 1

Views

Author

Keywords

Crossrefs

Analogs in other bases: A004676 (base 2), A001363 (base 3), A004679 (base 5), A004680 (base 6), A004681 (base 7), A004682 (base 8), A004683 (base 9), A000040 (base 10), A004684 (base 11).
Cf. A072805 (primes of form 4k+3 written in base 3).

Programs

  • Magma
    [Seqint(Intseq(NthPrime(n), 4)): n in [1..60]]; // G. C. Greubel, Oct 12 2018
  • Mathematica
    FromDigits/@IntegerDigits[Prime[Range[50]],4] (* Vincenzo Librandi, Sep 03 2016 *)
  • PARI
    a(n)=subst(Pol(digits(prime(n),4)),'x,10) \\ Charles R Greathouse IV, Nov 06 2013
    

Formula

a(n) = A007090(A000040(n)). - Jonathan Vos Post, Sep 09 2006

Extensions

More terms from Vincenzo Librandi, Sep 03 2016

A073791 Replace 4^k with (-4)^k in base 4 expansion of n.

Original entry on oeis.org

0, 1, 2, 3, -4, -3, -2, -1, -8, -7, -6, -5, -12, -11, -10, -9, 16, 17, 18, 19, 12, 13, 14, 15, 8, 9, 10, 11, 4, 5, 6, 7, 32, 33, 34, 35, 28, 29, 30, 31, 24, 25, 26, 27, 20, 21, 22, 23, 48, 49, 50, 51, 44, 45, 46, 47, 40, 41, 42, 43, 36, 37, 38, 39, -64, -63, -62, -61, -68, -67, -66, -65, -72, -71, -70, -69
Offset: 0

Views

Author

Robert G. Wilson v, Aug 12 2002

Keywords

Comments

Base 4 representation for n converted from base -4 to base 10.

Crossrefs

Programs

  • Mathematica
    f[n_Integer, b_Integer] := Block[{l = IntegerDigits[n]}, Sum[l[[ -i]]*(-b)^(i - 1), {i, 1, Length[l]}]]; a = Table[ FromDigits[ IntegerDigits[n, 4]], {n, 0, 80}]; b = {}; Do[b = Append[b, f[a[[n]], 4]], {n, 1, 80}]; b
  • PARI
    a(n) = subst(Pol(digits(n,4)), x, -4); \\ Michel Marcus, Jan 30 2019

Formula

a(4*k+m) = -4*a(k)+m for 0 <= m < 4. - Chai Wah Wu, Jan 16 2020

A010343 Base-4 Armstrong or narcissistic positive numbers.

Original entry on oeis.org

1, 2, 3, 130, 131, 203, 223, 313, 332, 1103, 3303
Offset: 1

Views

Author

Keywords

Crossrefs

Cf. A010344 (a(n) written in base 10).
In other bases: A010345 (base 5), A010347 (base 6), A010349 (base 7), A010351 (base 8), A010352 (base 9), A005188 (base 10).

Programs

Formula

a(n) = A007090(A010344(n)). - M. F. Hasler, Nov 18 2019

Extensions

Edited by Joseph Myers, Jun 28 2009
"Positive" added to definition. - N. J. A. Sloane, Nov 18 2019

A061819 Multiples of 3 containing only digits 0,1,2,3.

Original entry on oeis.org

0, 3, 12, 21, 30, 33, 102, 111, 120, 123, 132, 201, 210, 213, 222, 231, 300, 303, 312, 321, 330, 333, 1002, 1011, 1020, 1023, 1032, 1101, 1110, 1113, 1122, 1131, 1200, 1203, 1212, 1221, 1230, 1233, 1302, 1311, 1320, 1323, 1332, 2001, 2010, 2013, 2022, 2031
Offset: 1

Views

Author

Amarnath Murthy, May 28 2001

Keywords

Examples

			132 is a term containing digits less than 4.
		

Crossrefs

Cf. A061818.

Programs

  • Mathematica
    Select[3*Range[0,750],Max[IntegerDigits[#]]<4&] (* Harvey P. Dale, Jul 10 2014 *)

Formula

a(n) = A007090(3n), i.e. can also be read as multiples of 3 (A008585) written in base 4.

Extensions

Corrected and extended by Larry Reeves (larryr(AT)acm.org) and Henry Bottomley, May 30 2001

A085184 Sequence A085183 shown in base 4. Quaternary code for binary trees.

Original entry on oeis.org

0, 1, 2, 11, 12, 21, 22, 30, 111, 112, 121, 122, 130, 211, 212, 221, 222, 230, 301, 302, 310, 320, 1111, 1112, 1121, 1122, 1130, 1211, 1212, 1221, 1222, 1230, 1301, 1302, 1310, 1320, 2111, 2112, 2121, 2122, 2130, 2211, 2212, 2221, 2222, 2230, 2301, 2302
Offset: 1

Views

Author

Antti Karttunen, Jun 14 2003

Keywords

Comments

This sequence gives two alternative ways to encode rooted plane binary trees (Stanley's interpretation 'c' = interpretation 'd' without the outermost edges):
A: scan each term from left to right and for each 0, add a leaf node to the tree (terminate a branch), for each 1, add a leftward leaning branch \, for each 2, add a rightward leaning branch / and for each 3, add a double-branch \/ and continue in left-to-right, depth-first fashion.
B: Like method A, but the roles of digits 1 and 2 are swapped. When one compares the generated trees to the "standard order" as specified in the illustrations for A014486, one obtains the permutation A074684/A074683 for the case A and A082356/A082355 for the case B.
If we assign the following weights for each digit: w(0) = -1, w(1) = w(2) = 0, w(3) = +1, then the sequence gives all base-4 numbers for which all the partial sums of digit weights (from the most significant to the least significant end) are nonnegative and the final sum is zero. The initial term 0 is considered to have no significant digits at all, so its total weight is zero also.

Examples

			For the first eleven terms the following binary trees are constructed with method A. With method B we would get their mirror images, although this doesn't hold in general (e.g. for terms like 301-320).
........................................................\......./......\...
.....................\......./.......\......./...........\......\....../...
..*......\....../.....\......\......./....../.....\/......\......\.....\...
..0......1......2.....11.....12.....21.....22.....30....111....112....121..
		

Crossrefs

Cf. A085185. Number of terms with n significant digits is given by A000108(n+1).

Formula

a(n) = A007090(A085183(n)).

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

A136333 Numbers containing only digits coprime to 10 in their decimal representation.

Original entry on oeis.org

1, 3, 7, 9, 11, 13, 17, 19, 31, 33, 37, 39, 71, 73, 77, 79, 91, 93, 97, 99, 111, 113, 117, 119, 131, 133, 137, 139, 171, 173, 177, 179, 191, 193, 197, 199, 311, 313, 317, 319, 331, 333, 337, 339, 371, 373, 377, 379, 391, 393, 397, 399, 711, 713, 717, 719, 731
Offset: 1

Views

Author

Reinhard Zumkeller, Mar 26 2008

Keywords

Comments

Numbers containing digits 1,3,7,9 only, or, numbers written in base 4 (cf. A007090) with digits mapped by: 0->1, 1->3, 2->7 and 3->9. - Reinhard Zumkeller, Jul 17 2014

Crossrefs

Cf. A007090, A091633 (primes), A245193.

Programs

  • Haskell
    import Data.List (intersect)
    a136333 n = a136333_list !! (n-1)
    a136333_list = filter (null . intersect "024568" . show) [1..]
    -- Reinhard Zumkeller, Jul 17 2014
    
  • Mathematica
    fQ[n_] := Block[{s = {1, 3, 7, 9}}, Union[Join[s, IntegerDigits@ n]] == s]; Select[ Range@ 1000, fQ] (* or *)
    depth = 3; FromDigits@# & /@ FlattenAt[ Table[ Tuples[{1, 3, 7, 9}, n], {n, depth}], {#} & /@ Range[depth]] (* Robert G. Wilson v, Jul 02 2014 *)
  • PARI
    isok(m) = my(d=digits(m)); apply(x->gcd(x, 10), d) == vector(#d, k, 1); \\ Michel Marcus, Feb 25 2022

Formula

Sum_{n>=1} 1/a(n) = 2.395867871130444522329053889312125689319669370758630349552737883715872077555... (calculated using Baillie and Schmelzer's kempnerSums.nb, see Links). - Amiram Eldar, Feb 15 2024

A346688 Replace 4^k with (-1)^k in base-4 expansion of n.

Original entry on oeis.org

0, 1, 2, 3, -1, 0, 1, 2, -2, -1, 0, 1, -3, -2, -1, 0, 1, 2, 3, 4, 0, 1, 2, 3, -1, 0, 1, 2, -2, -1, 0, 1, 2, 3, 4, 5, 1, 2, 3, 4, 0, 1, 2, 3, -1, 0, 1, 2, 3, 4, 5, 6, 2, 3, 4, 5, 1, 2, 3, 4, 0, 1, 2, 3, -1, 0, 1, 2, -2, -1, 0, 1, -3, -2, -1, 0, -4, -3, -2, -1, 0, 1, 2, 3, -1, 0, 1, 2, -2, -1, 0, 1, -3, -2, -1, 0, 1, 2, 3, 4, 0, 1, 2, 3, -1
Offset: 0

Views

Author

Ilya Gutkovskiy, Jul 29 2021

Keywords

Comments

If n has base-4 expansion abc..xyz with least significant digit z, a(n) = z - y + x - w + ...

Examples

			54 = 312_4, 2 - 1 + 3 = 4, so a(54) = 4.
		

Crossrefs

Programs

  • Mathematica
    nmax = 104; A[] = 0; Do[A[x] = x (1 + 2 x + 3 x^2)/(1 - x^4) - (1 + x + x^2 + x^3) A[x^4] + O[x]^(nmax + 1) // Normal, nmax + 1]; CoefficientList[A[x], x]
    Table[n + 5 Sum[(-1)^k Floor[n/4^k], {k, 1, Floor[Log[4, n]]}], {n, 0, 104}]
  • Python
    from sympy.ntheory.digits import digits
    def a(n):
        return sum(bi*(-1)**k for k, bi in enumerate(digits(n, 4)[1:][::-1]))
    print([a(n) for n in range(105)]) # Michael S. Branicky, Jul 29 2021

Formula

G.f. A(x) satisfies: A(x) = x * (1 + 2*x + 3*x^2) / (1 - x^4) - (1 + x + x^2 + x^3) * A(x^4).
a(n) = n + 5 * Sum_{k>=1} (-1)^k * floor(n/4^k).

A037576 Base-4 digits are, in order, the first n terms of the periodic sequence with initial period 1,3.

Original entry on oeis.org

1, 7, 29, 119, 477, 1911, 7645, 30583, 122333, 489335, 1957341, 7829367, 31317469, 125269879, 501079517, 2004318071, 8017272285, 32069089143, 128276356573, 513105426295, 2052421705181, 8209686820727, 32838747282909
Offset: 1

Views

Author

Keywords

Comments

Partial sums of A255465. - Klaus Purath, Mar 18 2021

Crossrefs

Cf. A007090 (numbers in base 4), A037582 (decimal), A265688 (binary), A118111.

Programs

  • Magma
    I:=[1, 7, 29]; [n le 3 select I[n] else 4*Self(n-1)+Self(n-2)-4*Self(n-3): n in [1..30]]; // Vincenzo Librandi, Jun 22 2012
    
  • Mathematica
    CoefficientList[Series[(1+3*x)/((x-1)*(4*x-1)*(1+x)),{x,0,30}],x] (*or*) LinearRecurrence[{4,1,-4},{1,7,29},40] (* Vincenzo Librandi, Jun 22 2012 *)
  • PARI
    my(x='x+O('x^99)); Vec(x*(1+3*x)/((1-x)*(1-4*x)*(1+x))) \\ Altug Alkan, Sep 21 2018
    
  • Python
    print([7*4**n//15 for n in range(1,30)]) # Karl V. Keller, Jr., Mar 09 2021

Formula

G.f.: x*(1+3*x)/((1-x)*(1-4*x)*(1+x)). - Vincenzo Librandi, Jun 22 2012
a(n) = 4*a(n-1) + a(n-2) - 4*a(n-3). - Vincenzo Librandi, Jun 22 2012
a(n) = (7*4^n + 3*(-1)^n - 10)/15. - Bruno Berselli, Jun 22 2012, corrected by Klaus Purath, Mar 18 2021.
a(n) = floor(7*4^n/15). - Karl V. Keller, Jr., Mar 09 2021
From Klaus Purath, Mar 18 2021: (Start)
a(n) = 16*a(n-2) - 3*(-1)^n + 10, assuming that a(0) = 0.
a(n) = 4*a(n-1) + 2 + (-1)^n.
a(n) = 5*a(n-1) - 4*a(n-2) + 2*(-1)^n, n > 2. (End)
Previous Showing 21-30 of 321 results. Next