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

A093137 Expansion of (1-7*x)/((1-x)*(1-10*x)).

Original entry on oeis.org

1, 4, 34, 334, 3334, 33334, 333334, 3333334, 33333334, 333333334, 3333333334, 33333333334, 333333333334, 3333333333334, 33333333333334, 333333333333334, 3333333333333334, 33333333333333334, 333333333333333334, 3333333333333333334, 33333333333333333334
Offset: 0

Views

Author

Paul Barry, Mar 24 2004

Keywords

Comments

Second binomial transform of 3*A001045(3n)/3+(-1)^n. Partial sums of A093138. A convex combination of 10^n and 1. In general the second binomial transform of k*Jacobsthal(3n)/3+(-1)^n is 1,1+k,1+11k,1+111k,... This is the case for k=3.
a(n) is the number of n-length sequences of decimal digits whose sum is divisible by 3. - Geoffrey Critzer, Jan 18 2014
This sequence appears in a family of curious cubic identities based on the Armstrong number 407 = A005188(13). See the formula section. For the analog identities based on 153 = A005188(10) see a comment on A246057 with the van der Poorten et al. reference and A281857. For those based on 370 = A005188(11) see A067275, A002277 and A281858. - Wolfdieter Lang, Feb 08 2017

Examples

			a(1)^2 = 16
a(2)^2 = 1156
a(3)^2 = 111556
a(4)^2 = 11115556
a(5)^2 = 1111155556
a(6)^2 = 111111555556
a(7)^2 = 11111115555556
a(8)^2 = 1111111155555556
a(9)^2 = 111111111555555556, etc... (see A102807). - _Philippe Deléham_, Oct 03 2011
Curious cubic identities: 407 = 4^3 + 0^3 + 7^3, 340067 = 34^3 + (00)^3 + 67^3, 334000677 = 334^3 + (000)^3 + 677^3, ... - _Wolfdieter Lang_, Feb 08 2017
		

References

  • David Wells, The Penguin Dictionary of Curious and Interesting Numbers. Penguin Books, NY, 1986, Revised edition 1987. See entry 3334 at p. 168.

Crossrefs

Programs

  • Mathematica
    nn=20; r=Solve[{s==4x s+3 x a+3x b+1,a==4x a+3x s+3x b,b==4x b+3x s+3x a},{s,a,b}]; CoefficientList[Series[s/.r,{x,0,nn}],x] (* Geoffrey Critzer, Jan 18 2014 *)
    Table[3*10^n/9 + 6/9, {n, 0, 20}] (* or *) NestList[10 # - 6 &, 1, 20] (* Michael De Vlieger, Feb 08 2017 *)
    LinearRecurrence[{11,-10},{1,4},20] (* Harvey P. Dale, Oct 07 2017 *)
  • PARI
    Vec((1-7*x)/((1-x)*(1-10*x)) + O (x^30)) \\ Michel Marcus, Feb 09 2017

Formula

a(n) = 3*10^n/9 + 6/9.
a(n) = 10*a(n-1)-6 with a(0)=1. - Vincenzo Librandi, Aug 02 2010
a(n)^3 + 0(n)^3 + A067275(n+1)^3 = concatenation(a(n), 0(n), A067275(n+1)) = A281859(n), where 0(n) denotes n 0's, n >= 1. - Wolfdieter Lang, Feb 08 2017
From Elmo R. Oliveira, Aug 17 2024: (Start)
E.g.f.: exp(x)*(exp(9*x) + 2)/3.
a(n) = 11*a(n-1) - 10*a(n-2) for n > 1. (End)

A169966 Numbers whose decimal expansion contains only 0's and 3's.

Original entry on oeis.org

0, 3, 30, 33, 300, 303, 330, 333, 3000, 3003, 3030, 3033, 3300, 3303, 3330, 3333, 30000, 30003, 30030, 30033, 30300, 30303, 30330, 30333, 33000, 33003, 33030, 33033, 33300, 33303, 33330, 33333, 300000, 300003, 300030, 300033, 300300, 300303, 300330, 300333
Offset: 1

Views

Author

N. J. A. Sloane, Aug 07 2010

Keywords

Crossrefs

Programs

  • Haskell
    a169966 n = a169966_list !! (n-1)
    a169966_list = map (* 3) a007088_list
    -- Reinhard Zumkeller, Jan 10 2012
    
  • Mathematica
    Map[FromDigits,Tuples[{0,3},6]] (* Paolo Xausa, Oct 30 2023 *)
  • PARI
    print1(0);for(d=1,5,for(n=2^(d-1),2^d-1,print1(", ");forstep(i=d-1,0,-1,print1((n>>i)%2*3)))) \\ Charles R Greathouse IV, Nov 16 2011
    
  • Python
    def a(n): return 3*int(bin(n)[2:])
    print([a(n) for n in range(40)]) # Michael S. Branicky, Mar 30 2021

Formula

a(n+1) = Sum_{k>=0} A030308(n,k)*A093138(k+1). - Philippe Deléham, Oct 16 2011
a(n) = 3 * A007088(n-1).

A349194 a(n) is the product of the sum of the first i digits of n, as i goes from 1 to the total number of digits of n.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 9, 12, 15, 18, 21, 24, 27, 30, 33, 36, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 36, 42, 48, 54, 60, 66, 72, 78, 84, 90, 49, 56, 63, 70, 77
Offset: 1

Views

Author

Malo David, Nov 10 2021

Keywords

Comments

The only primes in the sequence are 2, 3, 5 and 7. - Bernard Schott, Nov 23 2021

Examples

			For n=256, a(256) = 2*(2+5)*(2+5+6) = 182.
		

Crossrefs

Cf. A055642, A284001 (binary analog), A349190 (fixed points).
Cf. A007953 (sum of digits), A059995 (floor(n/10)).
Cf. A349278 (similar, with the last digits).

Programs

  • Magma
    f:=func; [f(n):n in [1..100]]; // Marius A. Burtea, Nov 23 2021
  • Mathematica
    Table[Product[Sum[Part[IntegerDigits[n],j],{j,i}],{i,Length[IntegerDigits[n]]}],{n,74}] (* Stefano Spezia, Nov 10 2021 *)
  • PARI
    a(n) = my(d=digits(n)); prod(i=1, #d, sum(j=1, i, d[j])); \\ Michel Marcus, Nov 10 2021
    
  • PARI
    first(n)=if(n<9,return([1..n])); my(v=vector(n)); for(i=1,9,v[i]=i); for(i=10,n, v[i]=sumdigits(i)*v[i\10]); v \\ Charles R Greathouse IV, Dec 04 2021
    
  • Python
    from math import prod
    from itertools import accumulate
    def a(n): return prod(accumulate(map(int, str(n))))
    print([a(n) for n in range(1, 100)]) # Michael S. Branicky, Nov 10 2021
    

Formula

For n>10: a(n) = a(A059995(n))*A007953(n) where A059995(n) = floor(n/10).
In particular, for n<100: a(n) = floor(n/10)*A007953(n)
From Bernard Schott, Nov 23 2021: (Start)
a(n) = 1 iff n = 10^k, k >= 0 (A011557).
a(n) = 2 iff n = 10^k + 1, k >= 0 (A000533 \ {1}).
a(n) = 3 iff n = 10^k + 2, k >= 0 (A133384).
a(n) = 5 iff n = 10^k + 4, k >= 0.
a(n) = 7 iff n = 10^k + 6, k >= 0. (End)
From Marius A. Burtea, Nov 23 2021: (Start)
a(A002275(n)) = n! = A000142(n), n >= 1.
a(A090843(n - 1)) = (2*n - 1)!! = A001147(n), n >= 1.
a(A097166(n)) = (3*n - 2)!!! = A007559(n).
a(A093136(n)) = 2^n = A000079(n).
a(A093138(n)) = 3^n = A000244(n). (End)

A350814 Numbers m such that the largest digit in the decimal expansion of 1/m is 3.

Original entry on oeis.org

3, 30, 33, 75, 300, 303, 330, 333, 429, 750, 813, 3000, 3003, 3030, 3125, 3300, 3330, 3333, 4290, 4329, 7500, 7575, 8130, 30000, 30003, 30030, 30300, 30303, 31250, 33000, 33300, 33330, 33333, 42900, 43290, 46875, 75000, 75075, 75750, 76923, 81103, 81300, 300000
Offset: 1

Views

Author

Bernard Schott, Jan 30 2022

Keywords

Comments

If m is a term, 10*m is also a term.
3 is the only prime up to 2.6*10^8 (see comments in A333237).
Some subsequences:
{3, 30, 300, ...} = A093138 \ {1}.
{3, 33, 333, ...} = A002277 \ {0}.
{3, 33, 303, 3003, ...} = 3 * A000533.
{3, 303, 30303, 3030303, ...} = 3 * A094028.

Examples

			As 1/33 = 0.0303030303..., 33 is a term.
As 1/75 = 0.0133333333..., 75 is a term.
As 1/429 = 0.002331002331002331..., 429 is a term.
		

Crossrefs

Similar with largest digit k: A333402 (k=1), A341383 (k=2), A333237 (k=9).
Subsequences: A002277 \ {0}, A093138 \ {1}.
Decimal expansion: A010701 (1/3), A010674 (1/33).

Programs

  • Mathematica
    Select[Range[10^5], Max[RealDigits[1/#][[1]]] == 3 &] (* Amiram Eldar, Jan 30 2022 *)
  • Python
    from fractions import Fraction
    from itertools import count, islice
    from sympy import n_order, multiplicity
    def repeating_decimals_expr(f, digits_only=False):
        """ returns repeating decimals of Fraction f as the string aaa.bbb[ccc].
            returns only digits if digits_only=True.
        """
        a, b = f.as_integer_ratio()
        m2, m5 = multiplicity(2,b), multiplicity(5,b)
        r = max(m2,m5)
        k, m = 10**r, 10**n_order(10,b//2**m2//5**m5)-1
        c = k*a//b
        s = str(c).zfill(r)
        if digits_only:
            return s+str(m*k*a//b-c*m)
        else:
            w = len(s)-r
            return s[:w]+'.'+s[w:]+'['+str(m*k*a//b-c*m)+']'
    def A350814_gen(startvalue=1): # generator of terms >= startvalue
        return filter(lambda m:max(repeating_decimals_expr(Fraction(1,m),digits_only=True)) == '3',count(max(startvalue,1)))
    A350814_list = list(islice(A350814_gen(),10)) # Chai Wah Wu, Feb 07 2022

Extensions

More terms from Amiram Eldar, Jan 30 2022

A352157 Numbers m such that the smallest digit in the decimal expansion of 1/m is 3, ignoring leading and trailing 0's.

Original entry on oeis.org

3, 12, 30, 120, 264, 275, 296, 300, 1200, 1875, 2112, 2640, 2664, 2750, 2952, 2960, 3000, 10656, 11808, 12000, 18750, 21120, 22944, 26016, 26400, 26640, 27500, 28125, 29088, 29520, 29600, 30000, 103424, 106560, 106656, 118080, 120000, 156288, 187500, 211200, 229440
Offset: 1

Views

Author

Keywords

Comments

Leading 0's are not considered, otherwise every integer >= 11 would be a term (see examples).
Trailing 0's are also not considered, otherwise numbers of the form 2^i*5^j with i, j >= 0, apart from 1 (A003592) would be terms.
If k is a term, 10*k is also a term; so, terms with no trailing zeros are all primitive terms: 3, 12, 264, 275, 296, 1875, ...

Examples

			m = 12 is a term since 1/12 = 0.08333333... and the smallest term after the leading 0 is 3.
m = 264 is a term since 1/264 = 0.003787878... and the smallest term after the leading 0's is 3.
		

Crossrefs

Cf. A093138 \ {1} (subsequence), A350814.
Similar with smallest digit k: A352154 (k=0), A352155 (k=1), A352156 (k=2), this sequence (k=3), A352158 (k=4), A352159 (k=5), A352160 (k=6), A352153 (no known term for k=7), A352161 (k=8), no term (k=9).

Programs

  • Mathematica
    f[n_] := Union[ Flatten[ RealDigits[ 1/n][[1]] ]]; Select[ Range@ 1100, Min@ f@# == 3 &]
  • Python
    from itertools import count, islice
    from sympy import multiplicity, n_order
    def A352157_gen(startvalue=1): # generator of terms >= startvalue
        for n in count(max(startvalue,1)):
            m2, m5 = multiplicity(2,n), multiplicity(5,n)
            k, m = 10**max(m2,m5), 10**(t := n_order(10,n//2**m2//5**m5))-1
            c = k//n
            s = str(m*k//n-c*m).zfill(t)
            if '0' not in s and min(str(c).lstrip('0')+s) == '3':
                yield n
    A352157_list = list(islice(A352157_gen(),20)) # Chai Wah Wu, Mar 28 2022

Formula

A352153(a(n)) = 3.

A328780 Nonnegative integers k such that k and k^2 have the same number of nonzero digits.

Original entry on oeis.org

0, 1, 2, 3, 10, 20, 30, 100, 200, 245, 247, 249, 251, 253, 283, 300, 448, 548, 949, 1000, 1249, 1253, 1416, 1747, 1749, 1751, 1753, 1755, 2000, 2245, 2247, 2249, 2251, 2253, 2429, 2450, 2451, 2470, 2490, 2498, 2510, 2530, 2647, 2830, 3000, 3747, 3751, 4480, 4899
Offset: 1

Views

Author

Bernard Schott, Oct 27 2019

Keywords

Comments

The idea of this sequence comes from the 1st problem of the 28th British Mathematical Olympiad in 1992 (see the link).
This sequence is infinite because the family of integers {10^k, k >= 0} (A011557) belongs to this sequence.
The numbers m, m + 1, m + 2 where m = 49*10^k - 3, or m = 99*10^k - 3, k >= 3 are terms with all nonzero digits. - Marius A. Burtea, Dec 21 2020

Examples

			247^2 = 61009, hence 247 and 61009 both have 3 nonzero digits, 247 is a term.
		

References

  • A. Gardiner, The Mathematical Olympiad Handbook: An Introduction to Problem Solving, Oxford University Press, 1997, reprinted 2011, Pb 1 pp. 57 and 109 (1992)

Crossrefs

Programs

  • Magma
    nz:=func; [k:k in [0..5000] | nz(k) eq nz(k^2)]; // Marius A. Burtea, Dec 21 2020
    
  • Maple
    q:= n->(f->f(n)=f(n^2))(t->nops(subs(0=[][], convert(t, base, 10)))):
    select(q, [$0..5000])[];  # Alois P. Heinz, Oct 27 2019
  • Mathematica
    Select[Range[0, 5000], Equal @@ Total /@ Sign@ IntegerDigits[{#, #^2}] &] (* Giovanni Resta, Feb 27 2020 *)
  • PARI
    isok(k) = hammingweight(digits(k)) == hammingweight(digits(k^2)); \\ Michel Marcus, Dec 22 2020

Extensions

More terms from Alois P. Heinz, Oct 27 2019

A351650 Integers m such that digsum(m) divides digsum(m^2) where digsum = sum of digits = A007953.

Original entry on oeis.org

1, 2, 3, 9, 10, 11, 12, 13, 18, 19, 20, 21, 22, 24, 27, 30, 31, 33, 36, 42, 45, 46, 54, 55, 63, 72, 74, 81, 90, 92, 99, 100, 101, 102, 103, 108, 110, 111, 112, 113, 117, 120, 121, 122, 123, 126, 128, 130, 132, 135, 144, 145, 153, 162, 171, 180, 189, 190, 191, 198
Offset: 1

Views

Author

Bernard Schott, Feb 16 2022

Keywords

Comments

This is a generalization of a problem proposed by French site Diophante in link.
The smallest term k such that the corresponding quotient = n is A280012(n).
The quotient is 1 iff m is in A058369 \ {0}.
If k is in A061909, then digsum(k^2) = digsum(k)^2.
If k is a term, 10*k is also a term.
There are infinitely many m such that both m and m+1 are in the sequence, for example subsequence A002283 \ {0}.
Corresponding quotients are in A351651.

Examples

			digit sum of 42 = 4+2 = 6; then 42^2 = 1764, digit sum of 1764 = 1+7+6+4 = 18; as 6 divides 18, 42 is a term.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[200], Divisible[Total[IntegerDigits[#^2]], Total[IntegerDigits[#]]] &] (* Amiram Eldar, Feb 16 2022 *)
  • PARI
    is(n)=sumdigits(n^2)%sumdigits(n) == 0 \\ David A. Corneth, Feb 16 2022
    
  • Python
    def sd(n): return sum(map(int, str(n)))
    def ok(n): return sd(n**2)%sd(n) == 0
    print([m for m in range(1, 200) if ok(m)]) # Michael S. Branicky, Feb 16 2022

Formula

A004159(a(n)) = A007953(a(n)) * A351651(n).

Extensions

More terms from David A. Corneth, Feb 16 2022

A174971 Periodic sequence: Repeat 3, -3.

Original entry on oeis.org

3, -3, 3, -3, 3, -3, 3, -3, 3, -3, 3, -3, 3, -3, 3, -3, 3, -3, 3, -3, 3, -3, 3, -3, 3, -3, 3, -3, 3, -3, 3, -3, 3, -3, 3, -3, 3, -3, 3, -3, 3, -3, 3, -3, 3, -3, 3, -3, 3, -3, 3, -3, 3, -3, 3, -3, 3, -3, 3, -3, 3, -3, 3, -3, 3, -3, 3, -3, 3, -3, 3, -3, 3, -3, 3, -3, 3, -3, 3, -3, 3, -3, 3, -3
Offset: 0

Views

Author

Klaus Brockhaus, Apr 04 2010

Keywords

Comments

Interleaving of A010701 and -A010701; signed version of A010701.
Essentially first differences of A010674.
Inverse binomial transform of 3 followed by A000004.
Second inverse binomial transform of A010701.
Third inverse binomial transform of A007283.
Fourth inverse binomial transform of A000244 without initial term 1.
Fifth inverse binomial transform of A164346.
Sixth inverse binomial transform of A005053 without initial term 1.
Seventh inverse binomial transform of A169604.
Eighth inverse binomial transform of A169634.
Ninth inverse binomial transform of A103333 without initial term 1.
Tenth inverse binomial transform of A013708.
Eleventh inverse binomial transform of A093138 without initial term 1.

Crossrefs

Cf. A010701 (all 3's sequence), A000004 (all zeros sequence), A007283 (3*2^n), A000244 (powers of 3), A164346 (3*4^n), A005053 (expand (1-2x)/(1-5x)), A169604 (3*6^n), A169634 (3*7^n), A103333 (expand (1-5x)/(1-8x)), A013708 (3^(2n+1)), A093138 (expand (1-7x)/(1-10x)).

Programs

  • Magma
    &cat[ [3, -3]: n in [0..41] ];
    [ 3*(-1)^n: n in [0..83] ];
    
  • Mathematica
    PadRight[{},120,{3,-3}] (* or *) NestList[-1#&,3,120] (* Harvey P. Dale, Dec 30 2023 *)
  • PARI
    a(n)=3*(-1)^n \\ Charles R Greathouse IV, Jun 13 2013

Formula

a(n) = 3*(-1)^n.
a(n) = -a(n-1) for n > 0; a(0) = 3.
a(n) = a(n-2) for n > 1; a(0) = 3, a(1) = -3.
G.f.: 3/(1+x).

A346178 Expansion of (1-2*x)/(1-10*x).

Original entry on oeis.org

1, 8, 80, 800, 8000, 80000, 800000, 8000000, 80000000, 800000000, 8000000000, 80000000000, 800000000000, 8000000000000, 80000000000000, 800000000000000, 8000000000000000, 80000000000000000, 800000000000000000, 8000000000000000000, 80000000000000000000
Offset: 0

Views

Author

Felix Fröhlich, Jul 09 2021

Keywords

Crossrefs

Cf. expansion of (1-k*x)/(1-10*x) A011557 (k=0), A196662 (k=3), A090019 (k=4), A093143 (k=5), A093141 (k=6), A093138 (k=7), A093136 (k=8).

Programs

  • PARI
    Vec((1-2*x)/(1-10*x) + O(x^20))

Formula

a(n) = 8*10^(n-1), n>0.
E.g.f.: (1 + 4*exp(10*x))/5. - Stefano Spezia, Jul 09 2021
Showing 1-9 of 9 results.