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.

A117960 Triangular numbers with only odd digits.

This page as a plain text file.
%I A117960 #54 Aug 23 2025 17:15:09
%S A117960 1,3,15,55,91,153,171,351,595,1711,1953,5151,5995,9591,11175,11935,
%T A117960 15753,15931,17391,17955,31375,33153,35511,73153,153735,171991,173755,
%U A117960 193131,193753,371953,399171,513591,551775,559153,571915,791911,917335,939135,1335795
%N A117960 Triangular numbers with only odd digits.
%C A117960 There are infinitely many terms. See Al Zimmermann link. - _Shyam Sunder Gupta_, Aug 16 2025
%H A117960 Jon E. Schoenfield, <a href="/A117960/b117960.txt">Table of n, a(n) for n = 1..10000</a> (first 1000 terms from Alois P. Heinz)
%H A117960 Shyam Sunder Gupta, <a href="https://doi.org/10.1007/978-981-97-2465-9_3">Triangular Numbers</a>, Exploring the Beauty of Fascinating Numbers, Springer (2025) Ch. 3, 82-125.
%H A117960 Al Zimmermann's Programming Contests, <a href="http://azspcs.com/Contest/OddlyTriangular">Oddly Triangular</a>, September 2022.
%F A117960 Intersection of A000217 and A014261. - _M. F. Hasler_, Nov 20 2021
%p A117960 b:= proc(n) option remember; local k; for k from
%p A117960       1+`if`(n=1, 0, b(n-1)) while 0=mul(irem(i, 2),
%p A117960       i=convert(k*(k+1)/2, base, 10) ) do od; k
%p A117960     end:
%p A117960 a:= n-> (t-> t*(t+1)/2)(b(n)):
%p A117960 seq(a(n), n=1..50);  # _Alois P. Heinz_, Jul 12 2015
%t A117960 Select[Table[n(n+1)/2,{n,0,1650}],ContainsOnly[IntegerDigits[#],{1,3,5,7,9}]&] (* _James C. McMahon_, Sep 24 2024 *)
%o A117960 (PARI) select( {is_A117960(n)=is_A000217(n)&&is_A014261(n)}, [2*n+1|n<-[0..99999]]) \\ _M. F. Hasler_, Nov 20 2021
%o A117960 (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
%o A117960 (Python)
%o A117960 from itertools import islice, count
%o A117960 def A117960(): return filter(lambda n: set(str(n)) <= {'1','3','5','7','9'}, (m*(m+1)//2 for m in count(0)))
%o A117960 A117960_list = list(islice(A117960(),20)) # _Chai Wah Wu_, Nov 22 2021
%Y A117960 Intersection of A000217 (triangular) and A014261 (only odd digits).
%Y A117960 Cf. A117978.
%K A117960 base,nonn,changed
%O A117960 1,2
%A A117960 Luc Stevens (lms022(AT)yahoo.com), May 03 2006
%E A117960 Some terms corrected by _Alois P. Heinz_, Jul 12 2015