A349243 Indices of triangular numbers A000217 with only odd digits.
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
Links
- S. S. Gupta, Can You Find (CYF) no. 55, Nov 11 2021.
Crossrefs
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))).
Comments