login
Composite numbers which in base 7 contain their largest proper factor as a substring.
1

%I #22 Feb 21 2021 12:44:01

%S 49,77,91,119,133,161,203,217,259,287,301,329,343,371,413,427,469,497,

%T 511,539,551,553,581,623,637,679,707,721,749,763,791,833,847,889,917,

%U 931,959,973,989,1001,1043,1057,1099,1127,1141,1169,1183,1211,1253

%N Composite numbers which in base 7 contain their largest proper factor as a substring.

%C Sequence contains every term of A084968 except 7. - _Bill McEachen_, Dec 29 2020

%H Harvey P. Dale, <a href="/A063163/b063163.txt">Table of n, a(n) for n = 1..1000</a>

%e 91 = 160_7 and its largest proper factor is 13 = 16_7 where 16 is a substring of 160. - _Bill McEachen_, Dec 30 2020

%t Do[ If[ !PrimeQ[ n ] && StringPosition[ ToString[ FromDigits[ IntegerDigits[ n, 7 ] ] ], ToString[ FromDigits[ IntegerDigits[ Divisors[ n ] [ [ -2 ] ], 7 ] ] ] ] != {}, Print[ n ] ], {n, 2, 2000} ]

%t Select[Range[1300],CompositeQ[#]&&SequenceCount[IntegerDigits[#,7],IntegerDigits[ Divisors[#][[-2]],7]]>0&] (* Requires Mathematica version 10 or later *) (* _Harvey P. Dale_, Feb 21 2021 *)

%o (PARI) isok(n)={mystr=digits(n,7);d=divisors(n);gpf=d[#d-1];seek=digits(gpf,7);ls=#seek;for(w=1,#mystr-ls+1,if(mystr[w]!=seek[1],next);for(h=1,ls-1,if(mystr[w+h]!=seek[h+1],break);if(h==ls-1,return(1))));return(0);} \\ _Bill McEachen_, Dec 31 2020

%Y Cf. A062238, A032742, A084968.

%K base,nonn

%O 1,1

%A _Robert G. Wilson v_, Aug 08 2001