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.

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))).

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.

A349247 Least n-digit number k with only odd digits such that the k-th triangular number also has only odd digits.

Original entry on oeis.org

1, 13, 177, 1777, 15173, 135173, 3397973, 13535137, 135157537, 1193111377, 11979759377, 119595919137, 1195991117973, 11979931335173, 119777591993777, 1199999593111377, 11977793913551137, 119593573333335733, 1195935733333335733, 11977593393931151137, 119759371717733717537
Offset: 1

Views

Author

M. F. Hasler, Nov 23 2021

Keywords

Comments

It appears that all a(n), n > 9, have initial digits "119".
It also appears that the sequence of digits of the terms converges to a limit, (1, 1, 9, 3, 1, ...). Can this be proved or disproved?

Crossrefs

Cf. A000217 (triangular numbers), A014261 (numbers with only odd digits), A117960 (triangular numbers with only odd digits), A349243 (indices of the former), A347475 (such indices with only odd digits), A355277 (largest such k-digit term).

Programs

  • PARI
    apply( A349247(n)=A347475_next(10^n\9), [1..15]) \\ Edited (moved function body to A347475) by M. F. Hasler, Sep 13 2022
    
  • Python
    from itertools import product
    def A349247(n):
        for a in product('13579',repeat=n):
            if set(str((m:=int(''.join(a)))*(m+1)>>1)) <= {'1', '3', '5', '7', '9'}:
                return m # Chai Wah Wu, Sep 08 2022
    
  • Python
    A349247 = lambda n: next_A347475(10**n//9) # M. F. Hasler, Sep 10 2022

Formula

a(n) = min { k in A347475 | k >= 10^(n-1) }.

A355277 Largest n-digit number k with only odd digits such that the k-th triangular number also has only odd digits.

Original entry on oeis.org

5, 17, 177, 5573, 79137, 791377, 7913777, 79971937, 557335733, 5995957537, 59995599137, 599591791137, 7991739957973, 79971739957537, 799739357539937, 7991713197753777, 79991971791119137, 799999173991317537, 7997391313911797973
Offset: 1

Views

Author

M. F. Hasler, Sep 07 2022

Keywords

Comments

It appears that all a(n), n > 12, have initial digits "799".
The first digit of a(n) is never 9. - Chai Wah Wu, Sep 08 2022
As in A347475, all terms with more than 2 digits end in 33, 37, 73 or 77. - M. F. Hasler, Sep 12 2022

Examples

			T(5) = A000217(5) = 5*6/2 = 5*3 = 15 has only odd digits, and neither T(7) nor T(9) have this property, therefore a(1) = 5.
		

Crossrefs

Cf. A000217 (triangular numbers), A014261 (numbers with only odd digits), A117960 (triangular numbers with only odd digits), A349243 (indices of the former), A347475 (such indices with only odd digits), A349247 (least k-digit term).

Programs

  • PARI
    apply( A355277(n)=A347475_prec(10^n), [1..15]) \\ M. F. Hasler, Sep 08 2022
  • Python
    from itertools import product
    def A355277(n):
        for a in '7531':
            for b in product('97531',repeat=n-1):
                m = int(a+''.join(b))
                if set(str(m*(m+1)>>1)) <= {'1', '3', '5', '7', '9'}:
                    return m # Chai Wah Wu, Sep 08 2022
    

Formula

a(n) = max { k in A347475 | k < 10^n }.

A117978 Triangular numbers with only even digits.

Original entry on oeis.org

0, 6, 28, 66, 406, 666, 820, 2080, 2628, 8646, 28680, 42486, 48828, 64620, 66066, 80200, 84666, 200028, 204480, 228826, 264628, 288420, 426426, 446040, 468028, 484620, 600060, 626640, 644680, 686206, 828828, 886446, 2222886, 2248260, 2862028, 2888406
Offset: 1

Views

Author

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

Keywords

Comments

There are infinitely many terms. For example all 88...88 6 44...44 6 with an equal number of 8's and 4's (their triangular indices being A185127). - Shyam Sunder Gupta, Aug 16 2025

Crossrefs

Intersection of A000217 and A014263.

Programs

Extensions

Corrected (a(32) was in error) and extended by Harvey P. Dale, Oct 21 2011

A355276 Number of n-digit terms in A347475.

Original entry on oeis.org

2, 2, 1, 4, 4, 6, 3, 8, 9, 12, 11, 18, 33, 37, 40, 43, 64, 77, 71, 118, 135, 167, 241
Offset: 1

Views

Author

M. F. Hasler, Sep 08 2022

Keywords

Crossrefs

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

Extensions

a(20)-a(23) from Michael S. Branicky, Sep 09 2022
Showing 1-6 of 6 results.