[seqfan] Re: Knife numbers
M. F. Hasler
oeis at hasler.fr
Sun Sep 21 17:35:02 CEST 2014
On Sat, Sep 20, 2014 at 4:58 PM, Eric Angelini <Eric.Angelini at kntv.be> wrote:
> Hello SeqFans,
> If I'm not wrong, the "Knife numbers"
> (as we might call them) are not in the
> database.
>
> A "knife number" K can be divided
> in two chunks P and Q such that P+Q
> divide K.
>
> K = 10, 12, 18, 20, 21, 24, 27, 30, 36, 40, 42, 45, 48, 50, 54, 60, 63, 70, 72, 80, 81, 84, 90, 105, 108, 110, 120, 126, 130, 132,...
>
> Examples:
> 12 is divisible by 1+2 (result = 4)
> 126 is divisible by 12+6 (result = 7)
> 132 is divisible by 1+32 (result = 4)
Hello Eric & SeqFans,
I think there are at least 4 possible definitions :
1. n=concat(a,b), a,b>0, and (a+b) | n
(here it is understood that none of a,b,n has leading zeros)
This is a subsequence of all the following:
2. n=concat(a,b), a>0, and (a+b) | n
(here a must be nonzero and b cannot have leading zeros but may be zero)
e.g. all n = concat(k,0) = 10k = 0 (mod k+0) are included
but 102 is not included.
3. (n%p + n\p) | n where 1 < p=10^k <= n and b>0
("b may have leading zeros" but must be nonzero)
(% = mod ; \ = div)
e.g. 102 = 0 (mod 1+02) is, but not all multiples of 10 are included
(10,20,..100 are excluded, 110 is allowed because =0 (mod 1+10))
4. (n%p + n\p) | n where 1 < p=10^k <= n
("b" may have leading zeros and even be zero)
(% = mod ; \ = div)
This includes all of the preceding.
(PARI)
is4(n)=n&&for(k=1,#Str(n)-1,n%([1,1]*divrem(n,10^k)||return(1))
is3(n)=n&&for(k=1,#Str(n)-1,n%([1,1]*divrem(n,10^k))==0&&(n%10^k)&&return(1))
is2(n)=n&&for(k=1,#Str(n)-1,n%([1,1]*divrem(n,10^k))==0&&(k==1||n%10^k>=10^(k-1))&&return(1))
is1(n)=n&&for(k=1,#Str(n)-1,n%([1,1]*divrem(n,10^k))==0&&(n%10^k>=10^(k-1))&&return(1))
for(n=1,999,is4(n)&&print1(n",")) \\ https://oeis.org/draft/A247624
12,18,21,24,27,36,42,45,48,54,63,72,81,84,105,108,110,126,132,144,147,162,168,189,198,216,220,231,243,264,288,297,324,330,396,405,...
for(n=1,999,is3(n)&&print1(n","))\\https://oeis.org/draft/A247625
12,18,21,24,27,36,42,45,48,54,63,72,81,84,102,105,108,110,126,132,144,147,162,168,189,198,201,204,207,209,216,220,231,243,264,288,...
for(n=1,999,is1(n)&&print1(n","))\\https://oeis.org/draft/A2476246
10,12,18,20,21,24,27,30,36,40,42,45,48,50,54,60,63,70,72,80,81,84,90,100,102,105,108,110,120,126,130,132,140,144,147,150,160,162,...
M.
More information about the SeqFan
mailing list