login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

a(n) is the smallest k different from n such that (n, k) is a Harshad amicable pair (see the comments).
0

%I #21 May 18 2016 19:27:38

%S 10,10,12,20,10,12,70,40,18,1,10,3,76,10,12,35,296,9,10,2,3,20,10,6,

%T 14,184,9,10,20999,3,100,10,12,98,16,9,10,11,12,4,10,6,99799,40,9,10,

%U 2099999,12,52,5,12,49,1000,9,10,11,12,1001,7998998,6,7999999,200,9,10,319,12,68989999,98,30,7,1000,9,10,11,12,13,56,15,10000,8

%N a(n) is the smallest k different from n such that (n, k) is a Harshad amicable pair (see the comments).

%C Let m and k be distinct integers and dsum(n) be the sum of digits of n. We call m and k Harshad amicable if dsum(m) divides k and dsum(k) divides m.

%C For any n with no Harshad amicable partner, a(n)=0.

%C Conjecture: the sequence contains no zeros.

%C Large terms of a(n) correspond to prime indices and prime indices whose sum of digits is prime correspond to particularly large terms.

%e For n=12, a(12)=3 as the smallest number such that its sum of digits (3) divides n and the sum of digits of n (3) divides a(n).

%e For n=13, a(13)=76 as the smallest number such that its sum of digits (13) divides n and the sum of digits of n (4) divides a(n).

%t lst={}; Do[k=1; While[ k!=n&& !(Divisible[n, Total@IntegerDigits@k]&& Divisible[k, Total@IntegerDigits@n]), k++]; If[k==n, k=n+1;While[!(Divisible[n, Total@IntegerDigits@k]&& Divisible[k, Total@IntegerDigits@n]), k++]];AppendTo[lst, k], {n, 1, 80}]; lst

%o (PARI) for(n=1, 80, k=1; while(k!=n && !(n%sumdigits(k)==0 && k%sumdigits(n)==0), k++); if(k==n, k=n+1; while(!(n%sumdigits(k)==0 && k%sumdigits(n)==0), k++)); print1(k ", "))

%Y Cf. A005349 (Harshad numbers), A007953 (digital sum).

%K nonn,base

%O 1,1

%A _Waldemar Puszkarz_, May 01 2016