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.

Previous Showing 21-30 of 67 results. Next

A117960 Triangular numbers with only odd digits.

Original entry on oeis.org

1, 3, 15, 55, 91, 153, 171, 351, 595, 1711, 1953, 5151, 5995, 9591, 11175, 11935, 15753, 15931, 17391, 17955, 31375, 33153, 35511, 73153, 153735, 171991, 173755, 193131, 193753, 371953, 399171, 513591, 551775, 559153, 571915, 791911, 917335, 939135, 1335795
Offset: 1

Views

Author

Luc Stevens (lms022(AT)yahoo.com), May 03 2006

Keywords

Comments

There are infinitely many terms. See Al Zimmermann link. - Shyam Sunder Gupta, Aug 16 2025

Crossrefs

Intersection of A000217 (triangular) and A014261 (only odd digits).
Cf. A117978.

Programs

  • Maple
    b:= proc(n) option remember; local k; for k from
          1+`if`(n=1, 0, b(n-1)) while 0=mul(irem(i, 2),
          i=convert(k*(k+1)/2, base, 10) ) do od; k
        end:
    a:= n-> (t-> t*(t+1)/2)(b(n)):
    seq(a(n), n=1..50);  # Alois P. Heinz, Jul 12 2015
  • Mathematica
    Select[Table[n(n+1)/2,{n,0,1650}],ContainsOnly[IntegerDigits[#],{1,3,5,7,9}]&] (* James C. McMahon, Sep 24 2024 *)
  • PARI
    select( {is_A117960(n)=is_A000217(n)&&is_A014261(n)}, [2*n+1|n<-[0..99999]]) \\ M. F. Hasler, Nov 20 2021
    
  • PARI
    apply( {A117960_row(n,t=10^n\9,L=List())=forvec(v=vector(n,i,[0,4]), is_A000217(n=t+fromdigits(v)*2)&&listput(L,n));L}, [1..6]) \\ row(n) = terms with n digits. Use concat(%) to flatten. - M. F. Hasler, Nov 23 2021
    
  • Python
    from itertools import islice, count
    def A117960(): return filter(lambda n: set(str(n)) <= {'1','3','5','7','9'}, (m*(m+1)//2 for m in count(0)))
    A117960_list = list(islice(A117960(),20)) # Chai Wah Wu, Nov 22 2021

Formula

Intersection of A000217 and A014261. - M. F. Hasler, Nov 20 2021

Extensions

Some terms corrected by Alois P. Heinz, Jul 12 2015

A045926 All digits even and nonzero.

Original entry on oeis.org

2, 4, 6, 8, 22, 24, 26, 28, 42, 44, 46, 48, 62, 64, 66, 68, 82, 84, 86, 88, 222, 224, 226, 228, 242, 244, 246, 248, 262, 264, 266, 268, 282, 284, 286, 288, 422, 424, 426, 428, 442, 444, 446, 448, 462, 464, 466, 468, 482, 484, 486, 488, 622, 624, 626, 628, 642
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Haskell
    a045926 n = a045926_list !! (n-1)
    a045926_list = filter (all (`elem` "2468") . show) [2, 4..]
    -- Reinhard Zumkeller, Jan 01 2013
    
  • Python
    def A045926(n):
        m = (3*n+1).bit_length()-1>>1
        return int(''.join((str(((3*n+1-(1<<(m<<1)))//(3<<((m-1-j)<<1))&3)+1) for j in range(m))))<<1 # Chai Wah Wu, Feb 08 2023

Formula

a(n) = 2 * A084544(n). - Reinhard Zumkeller, Jan 01 2013

Extensions

More terms from Patrick De Geest, Jun 15 1999

A061829 Multiples of 5 having only odd digits.

Original entry on oeis.org

5, 15, 35, 55, 75, 95, 115, 135, 155, 175, 195, 315, 335, 355, 375, 395, 515, 535, 555, 575, 595, 715, 735, 755, 775, 795, 915, 935, 955, 975, 995, 1115, 1135, 1155, 1175, 1195, 1315, 1335, 1355, 1375, 1395, 1515, 1535, 1555, 1575, 1595, 1715, 1735, 1755
Offset: 1

Views

Author

Amarnath Murthy, May 29 2001

Keywords

Examples

			135 = 5*27 is a term having all odd digits.
		

Crossrefs

Cf. A014261.

Programs

  • Maple
    L[1]:= [5]:
    for n from 2 to 4 do
      L[n]:= [seq(op(map(`+`,L[n-1],i*10^(n-1))),i=1..9,2)]
    od:
    map(op, [seq(L[i],i=1..4)]); # Robert Israel, Jun 10 2018
  • Mathematica
    Select[5 Range[370],Select[IntegerDigits[#],EvenQ]=={}&]  (* Harvey P. Dale, Feb 07 2011 *)
  • PARI
    is(n)=n%10==5 && #setintersect(Set(digits(n)),[0,2,4,6,8])==0 \\ Charles R Greathouse IV, Feb 15 2017

Formula

From Robert Israel, Jun 10 2018: (Start)
For n > 1, a(n) = 10*A014261(n-1) + 5.
a(5*n) = 25 + 10*a(n).
a(5*n+1) = 45 + 10*a(n).
a(5*n+2) = -35 + 10*a(n+1).
a(5*n+3) = -15 + 10*a(n+1).
a(5*n+4) = 5 + 10*a(n+1).
G.f. g(x) satisfies g(x) = -25 - 40*x + 5*(5+9*x-7*x^2-3*x^3+x^4)/(1-x^5) + 10*(1-x^5)*g(x^5)/(x^3*(1-x)).
(End)

Extensions

More terms from Larry Reeves (larryr(AT)acm.org), May 30 2001

A327453 Lexicographically earliest sequence of distinct positive numbers such that if we add three successive digits the result is divisible by 3.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 12, 31, 20, 15, 34, 23, 18, 37, 26, 42, 61, 29, 45, 64, 50, 48, 67, 53, 72, 91, 56, 75, 94, 59, 78, 97, 80, 120, 123, 126, 129, 150, 153, 156, 159, 180, 183, 186, 189, 420, 423, 426, 429, 450, 453, 456, 459, 480, 483, 486, 489, 720
Offset: 1

Views

Author

N. J. A. Sloane, Sep 22 2019

Keywords

Comments

The variant where the sum of two consecutive digits is divisible by 2 corresponds to A014261. - Rémy Sigrist, Sep 22 2019

References

  • Éric Angelini, Posting to Sequence Fans Mailing List, Sep 16 2019.

Crossrefs

Programs

  • PARI
    See Links section.

Extensions

More terms from Rémy Sigrist, Sep 22 2019

A327539 Starting from n: as long as the decimal representation starts with a positive even number, divide the largest such prefix by 2; a(n) corresponds to the final value.

Original entry on oeis.org

0, 1, 1, 3, 1, 5, 3, 7, 1, 9, 5, 11, 3, 13, 7, 15, 1, 17, 9, 19, 5, 11, 11, 13, 3, 15, 13, 17, 7, 19, 15, 31, 1, 33, 17, 35, 9, 37, 19, 39, 5, 11, 11, 13, 11, 15, 13, 17, 3, 19, 15, 51, 13, 53, 17, 55, 7, 57, 19, 59, 15, 31, 31, 33, 1, 35, 33, 37, 17, 39, 35, 71
Offset: 0

Views

Author

Rémy Sigrist, Nov 29 2019

Keywords

Comments

For n > 0, as long as we have a number whose decimal representation is the concatenation of a positive even number, say u, and a possibly empty string of odd digits, say v, we replace this number with the concatenation of u/2 and v; eventually only odd digits remain.

Examples

			For n = 10000:
- 10000 gives 10000/2 = 5000,
- 5000 gives 5000/2 = 2500,
- 2500 gives 2500/2 = 1250,
- 1250 gives 125/2 = 625,
- 625 gives 62/2 followed by 5 = 315,
- 315 has only odd digits, so a(10000) = 315.
		

Crossrefs

See A329249, A329424 and A329428 for similar sequences.

Programs

Formula

a(n) <= n with equality iff n = 0 or n belongs to A014261.
a(2*n) = a(n).
a(10*k + v) = 10*a(k) + v for any k >= 0 and v in {1, 3, 5, 7, 9}.
a(n) = 1 iff n is a power of 2.
a(n) = 3 iff n belongs to A007283.
a(n) = 5 iff n belongs to A020714.
a(n) = 7 iff n belongs to A005009.
a(n) = 9 iff n belongs to A005010.
a(n) = a(n+1) iff n belongs to A215145.

A349243 Indices of triangular numbers A000217 with only odd digits.

Original entry on oeis.org

1, 2, 5, 10, 13, 17, 18, 26, 34, 58, 62, 101, 109, 138, 149, 154, 177, 178, 186, 189, 250, 257, 266, 382, 554, 586, 589, 621, 622, 862, 893, 1013, 1050, 1057, 1069, 1258, 1354, 1370, 1634, 1658, 1738, 1754, 1777, 1786, 1853, 1885, 1965, 2657, 2666, 2741, 2818, 3218, 3346, 3445, 3457, 3794, 3845
Offset: 1

Views

Author

M. F. Hasler, Nov 20 2021

Keywords

Crossrefs

Cf. A000217 (triangular numbers), A014261 (numbers with only odd digits), A117960 (triangular numbers with only odd digits).

Programs

  • Maple
    a:= proc(n) option remember; local k; for k from
          1+`if`(n=1, 0, b(n-1)) while 0=mul(irem(i, 2),
          i=convert(k*(k+1)/2, base, 10)) do od; k
        end:
    seq(a(n), n=1..57);  # Alois P. Heinz, Nov 22 2021
  • Mathematica
    Select[Range[4000], AllTrue[IntegerDigits[#*(# + 1)/2], OddQ] &] (* Amiram Eldar, Nov 20 2021 *)
    Position[Accumulate[Range[4000]],?(AllTrue[IntegerDigits[#],OddQ]&)]//Flatten (* _Harvey P. Dale, Sep 06 2023 *)
  • PARI
    select( {is_A349243(n)=Set(digits(n*(n+1)\2)%2)==[1]}, [1..9999])
    
  • Python
    from itertools import islice, count
    def A349243(): return filter(lambda n: set(str(n*(n+1)//2)) <= {'1','3','5','7','9'}, count(0))
    A349243_list = list(islice(A349243(),20)) # Chai Wah Wu, Nov 22 2021

Formula

a(n) = floor(sqrt(2*A117960(n))).

A085557 Numbers that have more prime digits than nonprime digits.

Original entry on oeis.org

2, 3, 5, 7, 22, 23, 25, 27, 32, 33, 35, 37, 52, 53, 55, 57, 72, 73, 75, 77, 122, 123, 125, 127, 132, 133, 135, 137, 152, 153, 155, 157, 172, 173, 175, 177, 202, 203, 205, 207, 212, 213, 215, 217, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232
Offset: 1

Views

Author

Jason Earls, Jul 04 2003

Keywords

Comments

Begins to differ from A046034 at the 21st term (which is the first 3-digit term).

Examples

			133 is in the sequence as the prime digits are 3 and 3 (those are two digits; counted with multiplicity) and one nonprime digit 1 and so there are more prime digits than nonprime digits. - _David A. Corneth_, Sep 06 2020
		

Crossrefs

Programs

  • PARI
    is(n) = my(d = digits(n), c = 0); for(i = 1, #d, if(isprime(d[i]), c++)); c<<1 > #d \\ David A. Corneth, Sep 06 2020
    
  • Python
    from itertools import count, islice
    def A085557_gen(startvalue=1): # generator of terms
        return filter(lambda n:len(s:=str(n))<(sum(1 for d in s if d in {'2','3','5','7'})<<1),count(max(startvalue,1)))
    A085557_list = list(islice(A085557_gen(),20)) # Chai Wah Wu, Feb 08 2023

A091296 Semiprimes with odd digits.

Original entry on oeis.org

9, 15, 33, 35, 39, 51, 55, 57, 77, 91, 93, 95, 111, 115, 119, 133, 155, 159, 177, 319, 335, 339, 355, 371, 377, 391, 393, 395, 511, 515, 517, 519, 533, 535, 537, 551, 553, 559, 573, 579, 591, 597, 713, 717, 731, 737, 753, 755, 771, 779, 791, 793, 799, 913, 917
Offset: 1

Views

Author

Zak Seidov, Feb 22 2004

Keywords

Comments

Semiprimes with odd digits are more numerous than those with even digits, cf. A108636.

Crossrefs

Intersection of A001358 and A014261.

Programs

  • Mathematica
    Select[Range[1000], Plus@@Last/@FactorInteger[ # ]==2&&Union[OddQ/@IntegerDigits[ # ]]=={True}&]
    PrimeFactorExponentsAdded[n_] := Plus @@ Flatten[ Table[ #[[2]], {1}] & /@ FactorInteger[n]]; Select[ Range[ 938], PrimeFactorExponentsAdded[ # ] == 2 && Union[ OddQ /@ IntegerDigits[ # ]] == {True} &] (* Robert G. Wilson v, Feb 25 2004 *)
    Select[Range[1000], PrimeOmega[#]==2 && And@@OddQ[IntegerDigits[#]]&] (* Harvey P. Dale, Jul 12 2011 *)

Extensions

Corrected and extended by Ray Chandler and Robert G. Wilson v, Feb 25 2004
Edited by N. J. A. Sloane, Apr 20 2007

A325112 Integers k such that no nonzero subsequence of the decimal representation of k is divisible by 3.

Original entry on oeis.org

1, 2, 4, 5, 7, 8, 10, 11, 14, 17, 20, 22, 25, 28, 40, 41, 44, 47, 50, 52, 55, 58, 70, 71, 74, 77, 80, 82, 85, 88, 100, 101, 104, 107, 110, 140, 170, 200, 202, 205, 208, 220, 250, 280, 400, 401, 404, 407, 410, 440, 470, 500, 502, 505, 508, 520, 550, 580, 700
Offset: 1

Views

Author

Jonathan Kal-El Peréz, Mar 27 2019

Keywords

Comments

Integers whose decimal representation contains either just one nonzero digit, which is congruent to 1 or 2 (mod 3), or just two nonzero digits, which are either both == 1 (mod 3) or both == 2 (mod 3). - Robert Israel, Dec 25 2019

Examples

			From _David A. Corneth_, Sep 09 2024: (Start) 404 is in the sequence as its nonzero digits are (4,4). The nonzero subsequences of digits are (), (4), (4,4) with respective sums 0, 4, 8. None of these subsequences have a sum that is divisible by 3.
4160 is not in the sequence as one of its nonzero subsequences is (6) which sums to 6. As 6 is divisible by 3, 4160 is not in the sequence. (End)
		

Crossrefs

Cf. A014261 (for 2), A325113 (for 4), A261189 (for 5), A325114 (for 7).
A261188 is a subsequence.
A376045 is the complement.

Programs

  • Maple
    F:= proc(d) local i,j,k, g;
       g:= [1,2,4,5,7,8];
       op(sort([seq(i*10^(d-1),i=g), seq(seq(seq(i*10^(d-1) + j*10^k, j = select(t -> (t-i) mod 3 = 0, g)),k=0..d-2),i=g)]));
    end proc:
    seq(F(d),d=1..4); # Robert Israel, Dec 25 2019
  • Mathematica
    With[{k = 3}, Select[Range@ 700, NoneTrue[DeleteCases[FromDigits /@ Rest@ Subsequences[IntegerDigits@ #], 0], Mod[#, k] == 0 &] &]] (* Michael De Vlieger, Mar 31 2019 *)
  • Python
    from itertools import combinations
    def A325112(n):
        def bisection(f,kmin=0,kmax=1):
            while f(kmax) > kmax: kmax <<= 1
            while kmax-kmin > 1:
                kmid = kmax+kmin>>1
                if f(kmid) <= kmid:
                    kmax = kmid
                else:
                    kmin = kmid
            return kmax
        def f(x):
            c, l = 0, len(str(x))
            for i in range(l):
                k = 10**i
                for j in (1,2,4,5,7,8):
                    if j*k<=x:
                        c += 1
            for a in combinations((10**i for i in range(l)),2):
                for b in ((1, 1), (1, 4), (1, 7), (2, 2), (2, 5), (2, 8), (4, 1), (4, 4), (4, 7), (5, 2), (5, 5), (5, 8), (7, 1), (7, 4), (7, 7), (8, 2), (8, 5), (8, 8)):
                    if a[0]*b[0]+a[1]*b[1] <= x:
                        c += 1
            return n+x-c
        return bisection(f,n,n) # Chai Wah Wu, Sep 10 2024

A347475 Numbers k such that k and the k-th triangular number T(k) = k*(k+1)/2 have only odd digits.

Original entry on oeis.org

1, 5, 13, 17, 177, 1777, 3937, 5537, 5573, 15173, 55377, 55733, 79137, 135173, 195937, 339173, 377777, 399377, 791377, 3397973, 5199137, 7913777, 13535137, 17397537, 33993973, 37735377, 39993777, 59591173, 59919137, 79971937, 135157537, 139713973, 153177777
Offset: 1

Views

Author

M. F. Hasler, Nov 20 2021

Keywords

Comments

There is only 1 term with 3 digits and there are only 3 terms with 7 digits. It appears that this (7 digits) is the only length where no term starts with digit 1, and for any length L > 9, the smallest L-digit term (cf. A349247) starts with digits "119...".
Can it be proved that the number of L-digit terms (cf. A355276) tends to infinity as L -> oo?
Can it be proved (or disproved) that the sequence of initial digits of the smallest L-digit term A349247(L) converge, maybe to (1, 1, 9, 3, 1, 1, ...)?
The sequence contains all numbers of the form 33(9{n}7){k}3{n}, where {x} means to repeat the preceding digit or parenthesized sequence of digits x times, for n >= 1 and k = 2, 3 or 4, and for k = 5 with only one initial '3'. - M. F. Hasler, Sep 10 2022
The sequence also contains the infinite subsequence s(k) = 4*10^(1+2*k) - 10^(1+k) - 10^(2+2*k) + 34*10^(3+3*k) + (22*10^k-1)/3. - Kebbaj Mohamed Reda, Sep 11 2022
In the notation of the earlier comment, the above s(k) = 339{k+1}39{k}73{k}. - M. F. Hasler, Sep 13 2022

Examples

			The numbers k = 1, 5, 13, 17, 177, 1777, ... have only odd digits, and the associated triangular numbers T(k) = k*(k+1)/2 = 1, 15, 91, 153, 15753, 1579753, 7751953, ... also have only odd digits.
The same is true for k = 119311115937719393371311137, the smallest 27-digit term.
Any number of the form n = 339{k}79{k}73{k} yields T(n) = A000217(n) = 79{k}19{k}13{k-1}453{k+1}5{k}1{k} and therefore is in the sequence, where {k} means k times (the preceding digit), for any k >= 1.
		

Crossrefs

Cf. A000217 (triangular numbers), A014261 (numbers with only odd digits), A117960 (triangular numbers with only odd digits), A349243 (indices of the former), A349247 (least k-digit term), A355277 (largest k-digit term), A355276 (number of k-digit terms).

Programs

  • Mathematica
    q[n_] := AllTrue[IntegerDigits[n], OddQ]; Select[Range[10^6], And @@ q /@ {#, #*(# + 1)/2} &] (* Amiram Eldar, Nov 20 2021 *)
  • PARI
    apply( {A347475_row(n, t=10^n\9, L=List())=forvec(v=vector(n,i,[0,4]), is_A014261((1+n=t+fromdigits(v)*2)*n\2)&& listput(L,n));L}, [1..8]) \\ row(n) = terms with n digits. Use concat(%) to flatten the list.
    
  • PARI
    A347475_first(n)=vector(n,i, n = next_A347475(n*(i>1)+1))
    A347475_next(n)={my(t, p, f(v)=for(i=1, #v, bittest(v[i], 0) || return(10^(#v-i)))); while(((p=f(digits(n))) && !n+=p*10\9+if(p>99,22)-n%p) || p=f(digits(t=n*(n+1)\2)), n=max(sqrtint((t+p*10\9-t%p)*2), n+2));n} \\ used in A349247
    A347475_prec(n)={my(t, p, f(v)=for(i=1, #v, bittest(v[i], 0) || return(10^(#v-i)))); while(((p=f(digits(n))) && !n-=n%p+if(p>99 && n\p%10, 23, 3)) || p=f(digits(t=n*(n+1)\2)), n=min(sqrtint((t-t%p-1)*2), n-2); if(n>p=n%100, n+=select(t->t<=p,[77,73,37,33,-23])[1]-p)); n} \\ used in A355277. - M. F. Hasler, Sep 13 2022
    
  • Python
    from itertools import islice, count, product
    def A347345gen(): return filter(lambda k: set(str(k*(k+1)//2)) <= {'1','3','5','7','9'}, (int(''.join(d)) for l in count(1) for d in product('13579',repeat=l)))
    A347345_list = list(islice(A347345gen(),30)) # Chai Wah Wu, Dec 05 2021
    
  • Python
    from math import isqrt
    def first_even(n):
        "Return 10^k corresponding to first even digit in n."
        for i,c in enumerate(n := str(n), 1):
            if c in "02468": return 10**(len(n)-i)
    def next_A347475(n):
        "Return the least term > n."
        if f := first_even(n := n+1): # next larger having only odd digits
            n += f*10//9 - n % f
        while f := first_even(t := n*(n+1)//2):
            if f := first_even(n := max(isqrt((t + 10*f//9 - t % f)*2), n+2)):
                n += 10*f//9 - n % f
        return n  #  M. F. Hasler, Sep 08 2022
    N=1 # Example of use of the above function:
    for n in range(30): print(N := next_A347475(N), end=", ")

Formula

Intersection of A014261 and A349243.
Previous Showing 21-30 of 67 results. Next