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

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

A081582 Pascal-(1,7,1) array.

Original entry on oeis.org

1, 1, 1, 1, 9, 1, 1, 17, 17, 1, 1, 25, 97, 25, 1, 1, 33, 241, 241, 33, 1, 1, 41, 449, 1161, 449, 41, 1, 1, 49, 721, 3297, 3297, 721, 49, 1, 1, 57, 1057, 7161, 14721, 7161, 1057, 57, 1, 1, 65, 1457, 13265, 44961, 44961, 13265, 1457, 65, 1, 1, 73, 1921, 22121, 108353, 192969, 108353, 22121, 1921, 73, 1
Offset: 0

Views

Author

Paul Barry, Mar 23 2003

Keywords

Comments

One of a family of Pascal-like arrays. A007318 is equivalent to the (1,0,1)-array. A008288 is equivalent to the (1,1,1)-array. Rows include A017077, A081593, A081594. Coefficients of the row polynomials in the Newton basis are given by A013614.

Examples

			Rows begin
  1,  1,   1,    1,     1, ... A000012;
  1,  9,  17,   25,    33, ... A017077;
  1, 17,  97,  241,   449, ... A081593;
  1, 25, 241, 1161,  3297, ...
  1, 33, 449, 3297, 14721, ...
Triangle begins:
  1;
  1,  1;
  1,  9,    1;
  1, 17,   17,    1;
  1, 25,   97,   25,     1;
  1, 33,  241,  241,    33,    1;
  1, 41,  449, 1161,   449,   41,    1;
  1, 49,  721, 3297,  3297,  721,   49,  1;
  1, 57, 1057, 7161, 14721, 7161, 1057, 57, 1;
		

Crossrefs

Cf. Pascal (1,m,1) array: A123562 (m = -3), A098593 (m = -2), A000012 (m = -1), A007318 (m = 0), A008288 (m = 1), A081577 (m = 2), A081578 (m = 3), A081579 (m = 4), A081580 (m = 5), A081581 (m = 6), A143683 (m = 8).

Programs

  • Magma
    A081582:= func< n,k,q | (&+[Binomial(k, j)*Binomial(n-j, k)*q^j: j in [0..n-k]]) >;
    [A081582(n,k,7): k in [0..n], n in [0..12]]; // G. C. Greubel, May 26 2021
    
  • Mathematica
    Table[ Hypergeometric2F1[-k, k-n, 1, 8], {n,0,10}, {k,0,n}]//Flatten (* Jean-François Alcover, May 24 2013 *)
  • Sage
    flatten([[hypergeometric([-k, k-n], [1], 8).simplify() for k in (0..n)] for n in (0..12)]) # G. C. Greubel, May 26 2021

Formula

T(n,k) = Sum_{j = 0..n-k} binomial(n-k,j)*binomial(k,j)*8^j.
Riordan array (1/(1 - x), x*(1 + 7*x)/(1 - x)).
Square array T(n, k) defined by T(n, 0) = T(0, k)=1, T(n, k) = T(n, k-1) + 7*T(n-1, k-1) + T(n-1, k).
Rows are the expansions of (1 + 7*x)^k/(1 - x)^(k+1).
T(n, k) = Hypergeometric2F1([-k, k-n], [1], 8). - Jean-François Alcover, May 24 2013
E.g.f. for the n-th subdiagonal, n = 0,1,2,..., equals exp(x)*P(n,x), where P(n,x) is the polynomial Sum_{k = 0..n} binomial(n,k)*(8*x)^k/k!. For example, the e.g.f. for the second subdiagonal is exp(x)*(1 + 16*x + 64*x^2/2) = 1 + 17*x + 97*x^2/2! + 241*x^3/3! + 449*x^4/4! + 721*x^5/5! + .... - Peter Bala, Mar 05 2017
Sum_{k=0..n} T(n, k) = A015519(n+1). - G. C. Greubel, May 26 2021

A081502 Let n = 10x + y where 0 <= y <= 9, x >= 0. Then a(n) = 3x+y.

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Apr 22 2003

Keywords

Comments

Eswaran observes that n is divisible by 7 iff repeated application of a ends at the number 7.
a(n) is divisible by 7 iff n is divisible by 7: e.g., a(7) = a(14) = a(21) = 7, a(28) = a(35) = a(42) = 14 etc. - Zak Seidov, Mar 19 2014

References

  • R. Eswaran, Test of divisibility of the number 7, Abstracts Amer. Math. Soc., 23 (No. 2, 2002), #974-00-5, p. 275.

Crossrefs

Different from A028898 for n>=100 (e.g. a(111) = 34, A029989(111) = 13).

Programs

  • Maple
    A081502 := proc(n)
        local x,y ;
        y := modp(n,10) ;
        x := iquo(n,10) ;
        3*x+y ;
    end proc:
    seq(A081502(n),n=0..120) ; # R. J. Mathar, Oct 03 2014
  • Mathematica
    Table[n - 7 * Floor[n / 10], {n, 0, 100}] (* Joshua Oliver, Dec 04 2019 *)
  • PARI
    a(n) = 3*(n\10) + (n % 10); \\ Michel Marcus, Mar 19 2014
    
  • PARI
    a(n) = [3,1]*divrem(n,10); \\ Kevin Ryde, Dec 04 2019

Formula

G.f.: -x*(6*x^9-x^8-x^7-x^6-x^5-x^4-x^3-x^2-x-1) / (x^11-x^10-x+1). - Colin Barker, Mar 19 2014
a(n) = n-7*floor(n/10). - Wesley Ivan Hurt, May 12 2016

A244158 If n = Sum c_i * 10^i then a(n) = Sum c_i * Cat(i+1), where Cat(k) = A000108(k).

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, 5
Offset: 0

Views

Author

Antti Karttunen, Jun 22 2014

Keywords

Comments

This sequence converts any number from various "Catalan Base number systems" (when represented as decimal numbers) back to the integer the numeral represents: e.g. we have a(A014418(n)) = n and a(A244159(n)) = n (except for the latter this is eventually broken by the shortcomings of the decimal representation used, while for the former it works for all n, because no digits larger than 3 will ever appear in the terms of A014418).
A197433 is similar, but replaces 2^k with A000108(k+1) in binary expansion of n.
For 1- and 2-digit numbers the same as A156230. - R. J. Mathar, Jun 27 2014

Crossrefs

Differs from A028897 and A081594 for the first time at n=100, which here is a(100) = 5.

Programs

  • Maple
    A244158 := proc(n)
        local dgs,k ;
        dgs := convert(n,base,10) ;
        add( op(k,dgs)*A000108(k),k=1..nops(dgs)) ;
    end proc: # R. J. Mathar, Jan 31 2015

A081593 Third row of Pascal-(1,7,1) array A081582.

Original entry on oeis.org

1, 17, 97, 241, 449, 721, 1057, 1457, 1921, 2449, 3041, 3697, 4417, 5201, 6049, 6961, 7937, 8977, 10081, 11249, 12481, 13777, 15137, 16561, 18049, 19601, 21217, 22897, 24641, 26449, 28321, 30257, 32257, 34321, 36449, 38641, 40897, 43217, 45601, 48049, 50561, 53137
Offset: 0

Views

Author

Paul Barry, Mar 23 2003

Keywords

Crossrefs

Programs

Formula

a(n) = 1 - 16*n + 32*n^2.
G.f.: (1+7*x)^2/(1-x)^3.
From Elmo R. Oliveira, Jun 09 2025: (Start)
E.g.f.: exp(x)*(1 + 16*x + 32*x^2).
a(n) = 3*a(n-1) - 3*a(n-2) + a(n-3). (End)

A156230 Sum of the products of the digits of n and the positions of the digits m in n starting from the last digit.

Original entry on oeis.org

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, 3
Offset: 1

Views

Author

Cino Hilliard, Feb 06 2009

Keywords

Comments

Starts to differ from A081594 when n>=100. [From R. J. Mathar, Feb 19 2009]

Examples

			a(19) = 9*1 + 1*2 = 11.
		

Programs

  • Maple
    A156230 := proc(n)
        local dgs;
        dgs := convert(n,base,10) ;
        add(i*op(i,dgs),i=1..nops(dgs)) ;
    end proc:
    seq(A156230(n),n=1..100) ; # R. J. Mathar, Dec 02 2018
  • Mathematica
    pdn[n_]:=Module[{idn=IntegerDigits[n]},Total[idn Range[Length[idn],1,-1]]]; Array[pdn,80] (* Harvey P. Dale, Aug 22 2012 *)
  • PARI
    gr(n) = v=Vec((rev(n)));sum(x=1,length(v),x*eval(v[x]))
    gr1(n) = for(j=1,n,print1(gr(j)","))
    rev(str) = /* Get the reverse of the input string
    */ {
    local(tmp,s,j);
    tmp = Vec(Str(str));
    s="";
    forstep(j=length(tmp),1,-1,
    s=concat(s,tmp[j]));
    return(s)
    }

Formula

Let n = d(1)d(2)...d(m) where d(1),d(2),...,d(m) are the digits of n. Then a(n) = m*d1+(m-1)*d2+...+d(m).

Extensions

Changed the description, formula and Pari code Cino Hilliard, Feb 08 2009
More terms to separate from A322001. - R. J. Mathar, Dec 02 2018

A322001 Digits of n interpreted in factorial base: a(Sum d_k*10^k) = Sum d_k*k!

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, 6
Offset: 0

Views

Author

M. F. Hasler, Nov 27 2018

Keywords

Comments

More terms than usual are given to distinguish the sequence from A081594, A028897 and A244158, which agree up to a(99). The last two correspond to k! replaced by 2^k resp. Catalan(k).
This is a left inverse to A007623 (factorial base representation of n): A322001(A007623(n)) = n for all n >= 0. One could imagine variants which have a(n) = 0 or a(n) = -1 if n is not a term of A007623. Restricted to the range of A007623, it is also a right inverse to A007623, at least up to the 10 digit terms, beyond which A007623 becomes non-injective.

Crossrefs

Cf. A007623 (right inverse), A081594, A028897, A244158.

Programs

  • Mathematica
    a[n_] := Module[{d=Reverse@IntegerDigits[n]}, Sum[d[[i]]*i!, {i,1,Length[d]}]]; Array[a, 100, 0] (* Amiram Eldar, Nov 28 2018 *)
  • PARI
    A322001(n)=sum(i=1,#n=Vecrev(digits(n)),n[i]*i!) \\ M. F. Hasler, Nov 27 2018
Showing 1-7 of 7 results.