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

A322003 Indices where A028897(A322000(n)) increases. Partial sums of A072170(n,10).

Original entry on oeis.org

0, 1, 2, 4, 6, 10, 14, 20, 26, 36, 46, 59, 72, 90, 108, 130, 152, 182, 212, 248, 284, 329, 374, 426, 478, 542, 606, 678, 750, 834, 918, 1011, 1104, 1214, 1324, 1446, 1568, 1708, 1848, 2002, 2156, 2333, 2510, 2702, 2894, 3108, 3322, 3552, 3782, 4040, 4298, 4575, 4852, 5156, 5460, 5784, 6108, 6464, 6820, 7196, 7572, 7977, 8382
Offset: 0

Views

Author

M. F. Hasler, Feb 19 2019

Keywords

Comments

A322000 lists all nonnegative integers m ordered by increasing "decibinary" value N = A028897(m) = Sum d[i]*2^i where d[i] are the decimal digits of m. A072170(N,10) says in how many ways a given N can be written in that way. Accordingly, this is also the length of runs of identical values A028897(A322000(k)), and the partial sums, listed here as a(k), give the indices of A322000 where the decibinary value of the terms go up by one.
We have a(k) <= A000123(k-1) with equality for 1 <= k <= 10: the first differences of A000123 give back that sequence with terms duplicated, and this is the limiting column of A072170.

Crossrefs

Programs

  • PARI
    A322003(n)=sum(k=0,n-1,A072170(k,10))
    A322003_vec=vector(99,k,s=if(k>1,s)+A072170(k-1,10)) \\ more efficient for computing a large vector. Excludes the initial a(0) = 0 to have 1-based indices of the vector match the indices of the components a(n), n >= 1.

Formula

a(n) = Sum_{0 <= k < n} A072170(k,10).

A322010 Inverse permutation to A322000.

Original entry on oeis.org

0, 1, 2, 4, 6, 10, 14, 20, 26, 36, 3, 5, 7, 11, 15, 21, 27, 37, 46, 59, 8, 12, 16, 22, 28, 38, 47, 60, 72, 90, 17, 23, 29, 39, 48, 61, 73, 91, 108, 130, 30, 40, 49, 62, 74, 92, 109, 131, 152, 182, 50, 63, 75, 93, 110, 132, 153, 183, 212, 248, 76, 94, 111, 133, 154, 184, 213, 249
Offset: 0

Views

Author

M. F. Hasler, Feb 19 2019

Keywords

Comments

a(n) is the position of n in the list A322000 of "decibinary numbers", i.e., integers sorted according to their decibinary value A028897(n) = Sum d[i]*2^i, where d[i] are the decimal digits of n.
For 0 <= m <= 9, we have a(n) = A322003(n) = A000123(n-1), because 1..9 are the first few terms of A322000 where the decibinary value increases.
We see that a(10..19) = a(2..9)+1 concatenated with (46, 49). Then, a(20..29) = a(12..19)+1 concatenated with (72, 90). Then, a(30..39) = a(22..29)+1 concatenated with (108, 130), and so on. This yields an alternate way to compute the sequence.

Crossrefs

Programs

  • PARI
    vec_A322010=vecsort(A,,1)[1..vecmin(setminus([1..#A],Set(A)))-1] \\ Assumes the vector A = A322000(1..N) has been computed for some N. Exclude initial 0's to have correct (1-based) indices of the vectors.

A028897 If n = Sum c_i 10^i then a(n) = Sum c_i 2^i.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 4
Offset: 0

Views

Author

Keywords

Comments

For n<100, this is the same result as "If n = Sum c_i 10^i then a(n) = Sum c_i (i+1)". - Henry Bottomley, Apr 20 2001
n_2 in the notation of A122618.
Left inverse of A007088 (binary numbers), cf. formula from Karttunen. - M. F. Hasler, Jun 13 2023

Crossrefs

Differs from A081594 and A244158 for the first time at n = 100, which here is a(100) = 4.
See A322000 for integers ordered according to the value of a(n).

Programs

  • Haskell
    a028897 0 = 0
    a028897 n = 2 * a028897 n' + d where (n', d) = divMod n 10
    -- Reinhard Zumkeller, Nov 06 2014
  • Mathematica
    a[n_ /; n < 10] := n; a[n_] := a[n] = If[Mod[n, 10] != 0, a[n-1] + 1, 2*a[n/10]]; Table[a[n], {n, 0, 100}] (* Jean-François Alcover, Apr 02 2016 *)
  • PARI
    a(n)=if(n<1,0,if(n%10,a(n-1)+1,2*a(n/10)))
    
  • PARI
    A028897(n)=fromdigits(digits(n),2) \\ M. F. Hasler, Feb 14 2019
    (MIT/GNU Scheme) (define (A028897 n) (let loop ((z 0) (i 0) (n n)) (if (zero? n) z (loop (+ z (* (modulo n 10) (expt 2 i))) (1+ i) (floor->exact (/ n 10)))))) ;; Antti Karttunen, Jun 22 2014
    

Formula

a(n) = 2*a(floor(n/10)) + (n mod 10). - Henry Bottomley, Apr 20 2001
a(0) = 0, a(n) = 2*a(n/10) if n == 0 (mod 10), a(n) = a(n-1)+1 otherwise. - Benoit Cloitre, Dec 21 2002
For all n, a(A007088(n)) = n. - Antti Karttunen, Jun 22 2014

Extensions

More terms from Erich Friedman.
Terms up to n = 100 added by Antti Karttunen, Jun 22 2014
Showing 1-3 of 3 results.