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 10 results.

A104257 Square array T(a,n) read by antidiagonals: replace 2^i with a^i in binary representation of n, where a,n >= 2.

Original entry on oeis.org

2, 3, 3, 4, 4, 4, 5, 5, 9, 5, 6, 6, 16, 10, 6, 7, 7, 25, 17, 12, 7, 8, 8, 36, 26, 20, 13, 8, 9, 9, 49, 37, 30, 21, 27, 9, 10, 10, 64, 50, 42, 31, 64, 28, 10, 11, 11, 81, 65, 56, 43, 125, 65, 30, 11, 12, 12, 100, 82, 72, 57, 216, 126, 68, 31, 12, 13, 13, 121, 101, 90, 73, 343
Offset: 2

Views

Author

Ralf Stephan, Mar 05 2005

Keywords

Comments

Sums of distinct powers of a. Numbers having only {0,1} in a-ary representation.

Examples

			Array begins:
  2,  3,  4,  5,  6,  7,   8,   9, ...
  3,  4,  9, 10, 12, 13,  27,  28, ...
  4,  5, 16, 17, 20, 21,  64,  65, ...
  5,  6, 25, 26, 30, 31, 125, 126, ...
  6,  7, 36, 37, 42, 43, 216, 217, ...
  7,  8, 49, 50, 56, 57, 343, 344, ...
  8,  9, 64, 65, 72, 73, 512, 513, ...
  9, 10, 81, 82, 90, 91, 729, 730, ...
  ...
		

Crossrefs

Programs

  • Mathematica
    T[, 0] = 0; T[2, n] := n; T[a_, 2] := a;
    T[a_, n_] := T[a, n] = If[EvenQ[n], a T[a, n/2], a T[a, (n-1)/2]+1];
    Table[T[a-n+2, n], {a, 2, 13}, {n, 2, a}] // Flatten (* Jean-François Alcover, Feb 09 2021 *)
  • PARI
    T(a, n) = fromdigits(binary(n), a); \\ Michel Marcus, Aug 19 2022
  • Python
    def T(a, n): return n if n < 2 else (max(a, n) if min(a, n) == 2 else a*T(a, n//2) + n%2)
    print([T(a-n+2, n) for a in range(2, 14) for n in range(2, a+1)]) # Michael S. Branicky, Aug 02 2022
    

Formula

T(a, n) = (1/(a-1))*Sum_{j>=1} floor((n+2^(j-1))/2^j) * ((a-2)*a^(j-1) + 1).
T(a, n) = (1/(a-1))*Sum_{j=1..n} ((a-2)*a^A007814(j) + 1).
G.f. of a-th row: (1/(1-x)) * Sum_{k>=0} a^k*x^2^k/(1+x^2^k).
Recurrence: T(a, 2n) = a*T(a, n), T(a, 2n+1) = a*T(a, n) + 1, T(a, 0) = 0.

A077722 Primes which can be expressed as sums of distinct powers of 8.

Original entry on oeis.org

73, 521, 577, 4673, 32833, 33289, 33353, 36929, 37441, 262153, 262217, 262657, 295433, 299017, 299521, 2097673, 2101249, 2101313, 2134529, 2359369, 2359873, 2363393, 2363401, 2392073, 16777289, 16777729, 16810049, 16810561, 16814089
Offset: 1

Views

Author

Amarnath Murthy, Nov 19 2002

Keywords

Comments

Primes whose base 8 representations contain only 0's and 1's.
Intersection of A000040 and A033045. - Michel Marcus, Sep 14 2013

Crossrefs

Programs

  • PARI
    isok(n) = {digs = digits(n, 8); for (i = 1, #digs, if (digs[i] > 1, return (0));); return (1);}
    lista(nn) = {forprime (p=1, nn, if (isok(p), print1(p, ", ");););} \\ Michel Marcus, Sep 14 2013
    
  • PARI
    forstep(n=7,999,2,t=fromdigits(binary(n),8); if(isprime(t), print1(t", "))) \\ Charles R Greathouse IV, Jun 08 2015

Extensions

More terms from Francois Jooste (phukraut(AT)hotmail.com), Dec 23 2002

A097254 Numbers whose set of base 8 digits is {0,7}.

Original entry on oeis.org

0, 7, 56, 63, 448, 455, 504, 511, 3584, 3591, 3640, 3647, 4032, 4039, 4088, 4095, 28672, 28679, 28728, 28735, 29120, 29127, 29176, 29183, 32256, 32263, 32312, 32319, 32704, 32711, 32760, 32767, 229376, 229383, 229432, 229439, 229824
Offset: 1

Views

Author

Ray Chandler, Aug 03 2004

Keywords

Comments

n such that there exists a permutation p_1, ..., p_n of 1, ..., n such that i + p_i is a power of 8 for every i.

Crossrefs

Programs

  • Magma
    [n: n in [0..250000] | Set(IntegerToSequence(n, 8)) subset {0, 7}]; // Vincenzo Librandi, May 25 2012
    
  • Mathematica
    fQ[n_]:=Union@Join[{0,7},IntegerDigits[n,8]]=={0,7};Select[Range[0,300000],fQ] (* Vincenzo Librandi, May 25 2012 *)
    FromDigits[#,8]&/@Tuples[{0,7},6] (* Harvey P. Dale, Aug 10 2021 *)
  • Maxima
    a[1]:0$ a[n]:=8*a[floor((n+1)/2)]+7*(1+(-1)^n)/2$ makelist(a[n], n, 1, 37); /* Bruno Berselli, May 25 2012 */
    
  • PARI
    a(n) = 7*fromdigits(binary(n-1), 8) \\ Rémy Sigrist, Dec 06 2018

Formula

a(n) = 7*A033045(n-1).
a(2n-1) = 8*a(n), a(2n) = 8*a(n)+7.

A063012 Sum of distinct powers of 20; i.e., numbers with digits in {0,1} base 20; i.e., write n in base 2 and read as if written in base 20.

Original entry on oeis.org

0, 1, 20, 21, 400, 401, 420, 421, 8000, 8001, 8020, 8021, 8400, 8401, 8420, 8421, 160000, 160001, 160020, 160021, 160400, 160401, 160420, 160421, 168000, 168001, 168020, 168021, 168400, 168401, 168420, 168421, 3200000, 3200001, 3200020, 3200021, 3200400, 3200401
Offset: 0

Views

Author

Henry Bottomley, Jul 04 2001

Keywords

Examples

			a(5) = 401 since 5 written in base 2 is 101 so a(5) = 1*20^2 + 0*20^1 + 1*20^0 = 400 + 0 + 1 = 401.
		

Crossrefs

A063013 is similar in a different way.

Programs

  • Maple
    a:= proc(n) `if`(n<2, n, irem(n, 2, 'r')+20*a(r)) end:
    seq(a(n), n=0..37);  # Alois P. Heinz, Apr 04 2025
  • Mathematica
    Table[FromDigits[IntegerDigits[n,2],20],{n,0,40}] (* Harvey P. Dale, Jul 21 2014 *)
  • PARI
    baseE(x, b)= { local(d, e, f); e=0; f=1; while (x>0, d=x-b*(x\b); x\=b; e+=d*f; f*=10); return(e) }
    baseI(x, b)= { local(d, e, f); e=0; f=1; while (x>0, d=x-10*(x\10); x\=10; e+=d*f; f*=b); return(e) }
    { for (n=0, 1000, write("b063012.txt", n, " ", baseI(baseE(n, 2), 20)) ) } \\ Harry J. Smith, Aug 15 2009
    
  • Python
    def A063012(n): return int(bin(n)[2:],20) # Chai Wah Wu, Apr 04 2025

Formula

a(n) = a(n-2^floor(log_2(n))) + 20^floor(log_2(n)). a(2n) = 20*a(n); a(2n+1) = a(2n)+1 = 20*a(n)+1.
a(n) = Sum_{k>=0} A030308(n,k)*A009964(k). - Philippe Deléham, Oct 15 2011
G.f.: (1/(1 - x))*Sum_{k>=0} 20^k*x^(2^k)/(1 + x^(2^k)). - Ilya Gutkovskiy, Jun 04 2017

Extensions

Edited by Charles R Greathouse IV, Aug 02 2010

A152111 An increasing basis of order 3. See Comments for full definition.

Original entry on oeis.org

0, 1, 2, 4, 8, 9, 16, 18, 32, 36, 64, 65, 72, 73, 128, 130, 144, 146, 256, 260, 288, 292, 512, 513, 520, 521, 576, 577, 584, 585, 1024, 1026, 1040, 1042, 1152, 1154, 1168, 1170, 2048, 2052, 2080, 2084, 2304, 2308, 2336, 2340, 4096, 4097, 4104, 4105, 4160
Offset: 1

Views

Author

David S. Newman, Mar 22 2009

Keywords

Comments

Using the terminology of A008932, call a set A a basis of order h if every number can be written as the sum of h (not necessarily distinct) elements of A. Call a basis an increasing basis of order h if its elements are arranged in increasing order, a0 < a1 < a2 < ...
This sequence is constructed as follows: Take the union of the following three sets: (1) the set of all nonnegative numbers which can be written in base two as sums of powers, k, of 2, where k is congruent to 0 mod 3; (2) the set of all nonnegative numbers which can be written in base two as sums of powers, k, of 2, where k is congruent to 1 mod 3; (3) the set of all nonnegative numbers which can be written in base two as sums of powers, k, of 2, where k is congruent to 2 mod 3.
Numbers of the form A033045(k), or 2*A033045(k), or 4*A033045(k). - R. J. Mathar, Sep 21 2009
There are 3*2^i - 1 terms up to 8^i. - David A. Corneth, Aug 02 2017

Crossrefs

Programs

  • Maple
    ismod3 := proc(n,m) b := convert(n,base,2) ; for i from 1+((m+1) mod 3) to nops(b) by 3 do if op(i,b) <> 0 then RETURN(false) ; fi; od: for i from 1 + ((m+2) mod 3) to nops(b) by 3 do if op(i,b) <> 0 then RETURN(false) ; fi; od: true ; end: for n from 0 to 20700 do if ismod3(n,0) or ismod3(n,1) or ismod3(n,2) then printf("%d,",n); fi; od: # R. J. Mathar, Sep 21 2009
  • PARI
    upto(n) = {my(i = 1, r, res = List()); while(1, b = binary(i); r = sum(i=1, #b, 8^i*b[#b+1-i])>>3; if(r > n, break); listput(res, r); i+=2); q = #res; for(i=1,  q, e = res[i] << 1; while(e <= n, listput(res, e); e=e<<1)); listput(res, 0); listsort(res); res} \\ David A. Corneth, Aug 02 2017

Extensions

More terms from R. J. Mathar, Sep 21 2009

A351995 Square array A(n, k), n, k >= 0, read by antidiagonals upwards; A(n, k) = Sum_{ i >= 0 } b_i * 2^(k*i) where n = Sum_{ i >= 0 } b_i * 2^i.

Original entry on oeis.org

0, 1, 0, 1, 1, 0, 2, 2, 1, 0, 1, 3, 4, 1, 0, 2, 4, 5, 8, 1, 0, 2, 5, 16, 9, 16, 1, 0, 3, 6, 17, 64, 17, 32, 1, 0, 1, 7, 20, 65, 256, 33, 64, 1, 0, 2, 8, 21, 72, 257, 1024, 65, 128, 1, 0, 2, 9, 64, 73, 272, 1025, 4096, 129, 256, 1, 0, 3, 10, 65, 512, 273, 1056, 4097, 16384, 257, 512, 1, 0
Offset: 0

Views

Author

Rémy Sigrist, Feb 27 2022

Keywords

Comments

In other words, in binary expansion of n, replace 2^i by 2^(k*i).

Examples

			Square array A(n, k) begins:
  n\k|  0  1   2   3    4     5     6      7      8       9       10
  ------------------------------------------------------------------
    0|  0  0   0   0    0     0     0      0      0       0        0
    1|  1  1   1   1    1     1     1      1      1       1        1
    2|  1  2   4   8   16    32    64    128    256     512     1024
    3|  2  3   5   9   17    33    65    129    257     513     1025
    4|  1  4  16  64  256  1024  4096  16384  65536  262144  1048576
    5|  2  5  17  65  257  1025  4097  16385  65537  262145  1048577
    6|  2  6  20  72  272  1056  4160  16512  65792  262656  1049600
    7|  3  7  21  73  273  1057  4161  16513  65793  262657  1049601
		

Crossrefs

Programs

  • Mathematica
    A351995[n_, k_] := If[n <= 1, n, Total[2^(k*(Flatten[Position[Reverse[IntegerDigits[n, 2]], 1]] - 1))]];
    Table[A351995[n - k, k], {n, 0, 15}, {k, 0, n}] (* Paolo Xausa, Aug 26 2025 *)
  • PARI
    A(n,k) = { my (v=0, e); while (n, n-=2^e=valuation(n, 2); v+=2^(k*e)); v }

Formula

A(A(n, k), k') = A(n, k*k') for k, k' > 0.
A(n, 0) = A000120(n).
A(n, 1) = n.
A(n, 2) = A000695(n).
A(n, 3) = A033045(n).
A(n, 4) = A033052(n).
A(0, k) = 0.
A(1, k) = 1.
A(2, k) = 2^k.
A(3, k) = 2^k + 1.

A341907 T(n, k) is the result of replacing 2^e with k^e in the binary expansion of n; square array T(n, k) read by antidiagonals upwards, n, k >= 0.

Original entry on oeis.org

0, 1, 0, 0, 1, 0, 1, 1, 1, 0, 0, 2, 2, 1, 0, 1, 1, 3, 3, 1, 0, 0, 2, 4, 4, 4, 1, 0, 1, 2, 5, 9, 5, 5, 1, 0, 0, 3, 6, 10, 16, 6, 6, 1, 0, 1, 1, 7, 12, 17, 25, 7, 7, 1, 0, 0, 2, 8, 13, 20, 26, 36, 8, 8, 1, 0, 1, 2, 9, 27, 21, 30, 37, 49, 9, 9, 1, 0, 0, 3, 10, 28, 64, 31, 42, 50, 64, 10, 10, 1, 0
Offset: 0

Views

Author

Rémy Sigrist, Jun 04 2021

Keywords

Comments

For any n >= 0, the n-th row, k -> T(n, k), corresponds to a polynomial in k with coefficients in {0, 1}.
For any k > 1, the k-th column, n -> T(n, k), corresponds to sums of distinct powers of k.

Examples

			Array T(n, k) begins:
  n\k|  0  1   2   3   4    5    6    7    8    9    10    11    12
  ---+-------------------------------------------------------------
    0|  0  0   0   0   0    0    0    0    0    0     0     0     0
    1|  1  1   1   1   1    1    1    1    1    1     1     1     1
    2|  0  1   2   3   4    5    6    7    8    9    10    11    12
    3|  1  2   3   4   5    6    7    8    9   10    11    12    13
    4|  0  1   4   9  16   25   36   49   64   81   100   121   144
    5|  1  2   5  10  17   26   37   50   65   82   101   122   145
    6|  0  2   6  12  20   30   42   56   72   90   110   132   156
    7|  1  3   7  13  21   31   43   57   73   91   111   133   157
    8|  0  1   8  27  64  125  216  343  512  729  1000  1331  1728
    9|  1  2   9  28  65  126  217  344  513  730  1001  1332  1729
   10|  0  2  10  30  68  130  222  350  520  738  1010  1342  1740
   11|  1  3  11  31  69  131  223  351  521  739  1011  1343  1741
   12|  0  2  12  36  80  150  252  392  576  810  1100  1452  1872
		

Crossrefs

Programs

  • PARI
    T(n,k) = { my (v=0, e); while (n, n-=2^e=valuation(n,2); v+=k^e); v }

Formula

T(n, n) = A104258(n).
T(n, 0) = A000035(n).
T(n, 1) = A000120(n).
T(n, 2) = n.
T(n, 3) = A005836(n).
T(n, 4) = A000695(n).
T(n, 5) = A033042(n).
T(n, 6) = A033043(n).
T(n, 7) = A033044(n).
T(n, 8) = A033045(n).
T(n, 9) = A033046(n).
T(n, 10) = A007088(n).
T(n, 11) = A033047(n).
T(n, 12) = A033048(n).
T(n, 13) = A033049(n).
T(0, k) = 0.
T(1, k) = 1.
T(2, k) = k.
T(3, k) = k + 1.
T(4, k) = k^2.
T(5, k) = k^2 + 1 = A002522(k).
T(6, k) = k^2 + k = A002378(k).
T(7, k) = k^2 + k + 1 = A002061(k).
T(8, k) = k^3.
T(9, k) = k^3 + 1 = A001093(k).
T(10, k) = k^3 + k = A034262(k).
T(11, k) = k^3 + k + 1 = A071568(k).
T(12, k) = k^3 + k^2 = A011379(k).
T(13, k) = k^3 + k^2 + 1 = A098547(k).
T(14, k) = k^3 + k^2 + k = A027444(k).
T(15, k) = k^3 + k^2 + k + 1 = A053698(k).
T(16, k) = k^4 = A000583(k).
T(17, k) = k^4 + 1 = A002523(k).
T(m + n, k) = T(m, k) + T(n, k) when m AND n = 0 (where AND denotes the bitwise AND operator).

A037413 Positive numbers having the same set of digits in base 2 and base 8.

Original entry on oeis.org

1, 8, 64, 65, 72, 512, 513, 520, 521, 576, 577, 584, 4096, 4097, 4104, 4105, 4160, 4161, 4168, 4169, 4608, 4609, 4616, 4617, 4672, 4673, 4680, 32768, 32769, 32776, 32777, 32832, 32833, 32840, 32841, 33280, 33281, 33288, 33289, 33344, 33345, 33352
Offset: 1

Views

Author

Keywords

Crossrefs

Subsequence of A033045.

Programs

  • PARI
    isok(n) = Set(digits(n, 2)) == Set(digits(n, 8)); \\ John Cerkan, Jan 13 2017

Extensions

a(28)-a(42) from John Cerkan, Jan 13 2017
Name edited by John Cerkan, Jan 14 2017

A135124 Numbers such that the digital sums in base 2, base 4 and base 8 are all equal.

Original entry on oeis.org

1, 64, 65, 4096, 4097, 4160, 4161, 262144, 262145, 262208, 262209, 266240, 266241, 266304, 266305, 16777216, 16777217, 16777280, 16777281, 16781312, 16781313, 16781376, 16781377, 17039360, 17039361, 17039424, 17039425, 17043456
Offset: 1

Views

Author

Hieronymus Fischer, Dec 31 2007, Dec 31 2008

Keywords

Comments

Written as base 64 numbers the sequence is 1,10,11,100,101,110,111,1000,1001, ... (cf. A007088)

Examples

			a(7)=4161, since ds_2(4161 )=ds_4(4161 )=ds_8(4161 ), where ds_x=digital sum base x.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[500000], Total[IntegerDigits[#, 2]] == Total[IntegerDigits[#, 4]] == Total[IntegerDigits[#, 8]] &] (* G. C. Greubel, Sep 26 2016 *)
    With[{k = 64}, Rest@ Map[FromDigits[#, k] &, Tuples[{0, 1}, 5]]] (* Michael De Vlieger, Oct 28 2022 *)
    Select[Range[171*10^5],Length[Union[Total/@IntegerDigits[#,{2,4,8}]]]==1&] (* Harvey P. Dale, May 14 2025 *)
  • PARI
    a(n) = fromdigits(binary(n),64); \\ Kevin Ryde, Apr 02 2025

Formula

a(n) = (1/2)*Sum_{k=0..floor(log_2(n))} (1-(-1)^floor(n/2^k))*64^k.
G.f.: (1/(1-x))*Sum_{k>=0} 64^k*x^(2^k)/(1+x^(2^k)).

Extensions

Edited by N. J. A. Sloane, Jan 17 2009

A147845 Odd positive integers a(n) such that for every odd integer m>=7 there exists a unique representation of the form m=a(p)+2a(q)+4a(r).

Original entry on oeis.org

1, 3, 17, 19, 129, 131, 145, 147, 1025, 1027, 1041, 1043, 1153, 1155, 1169, 1171, 8193, 8195, 8209, 8211, 8321, 8323, 8337, 8339, 9217, 9219, 9233, 9235, 9345, 9347, 9361, 9363, 65537, 65539, 65553, 65555
Offset: 1

Views

Author

Vladimir Shevelev, Nov 15 2008

Keywords

Comments

Since, e.g., 27=17+2*3+4*1 and 17=a(3),3=a(2),1=a(1), then 27 has "coordinates" (3,2,1). Thus we have a one-to-one map of odd integers >=7 to the positive lattice points in the three-dimensional space.

Crossrefs

Formula

a(n)=2A033045(n-1)+1
Showing 1-10 of 10 results.