login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A342846 Number of distinct odd numbers visible as proper substrings of n. 4
0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 2, 1, 2, 1, 2, 1, 2, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 2, 1, 1, 1, 2, 1, 2, 1, 2, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 2, 1, 2, 1, 1, 1, 2, 1, 2, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 2, 1, 2, 1, 2, 1, 1, 1, 2, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 1, 1, 1, 1, 2, 1, 2 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,13
COMMENTS
Here substrings are contiguous.
a(A164766(n)) = n and a(m) <> n for m < A164766(n); a(A014263(n)) = 0. - Reinhard Zumkeller, Aug 25 2009
LINKS
Sean A. Irvine, Java program (github)
EXAMPLE
a(10)=1 since we can see 1 as a proper substring of 10.
a(105)=2 since we can see 1, 5.
a(132)=3 because we can see 1, 3, 13.
PROG
(Haskell)
import Data.List (isInfixOf)
a045888 n = length $ filter (`isInfixOf` (show n)) $ map show [1, 3..n-1]
-- Reinhard Zumkeller, Jul 19 2011
(Python)
def a(n):
s, eset = str(n), set()
for i in range(len(s)):
for j in range(i+1, len(s)+1):
if s[j-1] in "13579" and j-i < len(s): # odd and proper substring
eset.add(int(s[i:j]))
return len(eset)
print([a(n) for n in range(1, 105)]) # Michael S. Branicky, Mar 24 2021
CROSSREFS
Sequence in context: A167404 A280223 A062754 * A045888 A335885 A335875
KEYWORD
nonn,base,easy
AUTHOR
Sean A. Irvine, Mar 24 2021
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 25 05:18 EDT 2024. Contains 371964 sequences. (Running on oeis4.)