login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A342304 k-digit positive numbers exactly one of whose substrings is divisible by k. 1
1, 2, 3, 4, 5, 6, 7, 8, 9, 21, 23, 25, 27, 29, 41, 43, 45, 47, 49, 61, 63, 65, 67, 69, 81, 83, 85, 87, 89, 101, 104, 107, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 122, 125, 128, 131, 134, 137, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 152, 155, 158, 161 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,2

COMMENTS

Inspired by the 413th problem of Project Euler (see link) where such a number is called "one-child number".

There are k*(k+1)/2 substrings.  All are considered, even when some are duplicates as strings or as numbers (see the Example section). 0 is always divisible by k so any number with two or more 0 digits is not a term. - Kevin Ryde, Mar 08 2021

The 2-digit terms are odd.

The number of k-digit terms for k = 1, 2, 3 is respectively 9, 20, 360.

From Robert Israel, Mar 11 2021: (Start)

5-digit terms are numbers starting with 5, and with no other digits 5 or 0.

There are no 10-digit terms. (End)

LINKS

Robert Israel, Table of n, a(n) for n = 1..10000

Project Euler, Problem 413: One-child Numbers.

EXAMPLE

107 is a 3-digit one-child number since among its substrings 1, 0, 7, 10, 07, 107 only 0 is divisible by 3.

222 is a 3-digit one-child number since among its substrings 2, 2, 2, 22, 22, 222 only 222 is divisible by 3.

572 is not a 3-digit one-child number, since among its substrings 5, 7, 1, 57, 72, 572 both 57 and 72 are divisible by 3.

616 is not a 3-digit one-child number, since among its substrings 6, 1, 6, 61, 16, 616 the two 6's are both divisible by 3.

MAPLE

filter:= proc(n) local L, d, i, j, k, ct, x;

  L:= convert(n, base, 10);

  d:= nops(L);

  ct:= 0:

  for i from 1 to d do

    for j from i to d do

      x:= add(L[k]*10^(k-i), k=i..j);

      if x mod d = 0 then ct:= ct+1; if ct = 2 then return false fi fi;

  od od;

  evalb(ct = 1)

end proc:

select(filter, [$1..200]); # Robert Israel, Mar 11 2021

CROSSREFS

Cf. A063527.

Sequence in context: A069571 A039173 A103951 * A098951 A097962 A247813

Adjacent sequences:  A342299 A342302 A342303 * A342306 A342307 A342308

KEYWORD

nonn,base

AUTHOR

Bernard Schott, Mar 08 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 | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 13 16:56 EDT 2021. Contains 343862 sequences. (Running on oeis4.)