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-6 of 6 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.

A102487 Numbers in base-12 representation that can be written with decimal digits.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 84, 85, 86
Offset: 1

Views

Author

Reinhard Zumkeller, Jan 12 2005

Keywords

Comments

Numbers that are only in this sequence or only in A039274 but not in both are n= 131, 142, 275, 286, 419, 430 etc: see A039558. [From R. J. Mathar, Aug 30 2008]

Crossrefs

Complement of A102488; A102489, A102491, A102493.
Cf. A033048 (subsequence).

Programs

  • Haskell
    import Data.List (unfoldr)
    a102487 n = a102487_list !! (n-1)
    a102487_list = filter (all (< 10) . unfoldr (\x ->
       if x == 0 then Nothing else Just $ swap $ divMod x 12)) [0..]
    -- Reinhard Zumkeller, Apr 18 2011
    
  • Mathematica
    fQ[n_] := Last@ Union@ IntegerDigits[n, 12] < 10; Select[ Range[0, 86], fQ] (* Robert G. Wilson v, Apr 17 2012 *)
  • PARI
    {for(testn=0,87,
    lgt=1;
    for(i=1,1000,if(12^i > testn,lgt=i;break()));
    atst=testn;pasr=1;
    for(j=1,lgt,lasd=atst%12;
    if(lasd<10,atst=(atst-lasd)/12,pasr=0;break()));
    if(pasr==1,print1(testn,", ")))}
    \\ Douglas Latimer, Apr 17 2012
    
  • Python
    A102487_list = [int(str(x), 12) for x in range(10**6)] # Chai Wah Wu, Apr 09 2016

A194887 Numbers that are the sum of two powers of 12.

Original entry on oeis.org

2, 13, 24, 145, 156, 288, 1729, 1740, 1872, 3456, 20737, 20748, 20880, 22464, 41472, 248833, 248844, 248976, 250560, 269568, 497664, 2985985, 2985996, 2986128, 2987712, 3006720, 3234816, 5971968, 35831809, 35831820, 35831952, 35833536, 35852544, 36080640
Offset: 1

Views

Author

Jeremy Gardiner, Oct 09 2011

Keywords

Comments

Parity of this sequence is A073424.

Examples

			12^0 + 12^2 = 145
		

Crossrefs

Programs

  • Mathematica
    t = 12^Range[0, 9]; Select[Union[Flatten[Table[i + j, {i, t}, {j, t}]]], # <= t[[-1]] + 1 &] (* T. D. Noe, Oct 09 2011 *)
    Total/@Tuples[12^Range[0,10],2]//Union (* Harvey P. Dale, Jul 20 2019 *)

Extensions

Typo in example corrected by Zak Seidov, Oct 23 2011

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

A097258 Numbers whose set of base 12 digits is {0,B}, where B base 12 = 11 base 10.

Original entry on oeis.org

0, 11, 132, 143, 1584, 1595, 1716, 1727, 19008, 19019, 19140, 19151, 20592, 20603, 20724, 20735, 228096, 228107, 228228, 228239, 229680, 229691, 229812, 229823, 247104, 247115, 247236, 247247, 248688, 248699, 248820, 248831, 2737152
Offset: 0

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 12 for every i.

Crossrefs

Programs

  • Magma
    [n: n in [0..2800000] | Set(IntegerToSequence(n, 12)) subset {0, 11}]; // Vincenzo Librandi, May 26 2012
  • Mathematica
    f[n_] := FromDigits[ IntegerDigits[n, 2] /. {1 -> 11}, 12]; Array[f, 33, 0] (* or much slower *)
    fQ[n_] := Union@ Join[{0, 11}, IntegerDigits[n, 12]] == {0, 11}; Select[ Range[0, 27370162], fQ] (* Robert G. Wilson v, May 12 2012 *)
    FromDigits[#,12]&/@Tuples[{0,11},6] (* Vincenzo Librandi, May 26 2012 *)

Formula

a(n) = 11*A033048(n).
a(2n) = 12*a(n), a(2n+1) = a(2n)+11.

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).
Showing 1-6 of 6 results.