cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A197816 Smallest composite number m such that m and the greatest prime divisor of m begin with n.

This page as a plain text file.
%I A197816 #11 Jun 04 2018 17:54:09
%S A197816 102,203,36,410,50,603,70,801,970,1010,110,1270,130,1490,1510,1630,
%T A197816 170,1810,190,20030,2110,2230,230,2410,2510,2630,2710,2810,290,3070,
%U A197816 310,32030,3310,3470,3530,3670,370,3830,3970,4010,410,4210,430,4430,4570,4610,470
%N A197816 Smallest composite number m such that m and the greatest prime divisor of m begin with n.
%C A197816 A majority of numbers are divisible by 10.
%C A197816 The case m prime gives A062584 (First occurrence of n in the decimal representation of primes).
%H A197816 Robert Israel, <a href="/A197816/b197816.txt">Table of n, a(n) for n = 1..10000</a>
%F A197816 a(n) = 10*A018800(n) for n >= 9. - _Robert Israel_, Jun 04 2018
%e A197816 a(6) = 603 = 3^2*67 => 603 and 67 start with 6.
%p A197816 with(numtheory): for n from 1 to 47 do: l1:=length(n):i:=0:for m from 2 to 100000 while(i=0) do: x:=factorset(m):k:=nops(x):y:=x[k]: l2:=length(m):x1:=floor(m/(10^(l2-l1))): l3:=length(y):x2:=floor(y/(10^(l3-l1))):if x1=n and x2=n and l2>=l1 and l3 >=l1 and type(m,prime)=false then i:=1: printf(`%d, `,m):else fi :od:od:
%p A197816 # Alternative:
%p A197816 f:= proc(n) local d,k,p;
%p A197816   for d from 1 do
%p A197816     for k from 10^d*n to 10^d*(n+1)-1 do
%p A197816        if not isprime(k) then
%p A197816          p:= max(numtheory:-factorset(k));
%p A197816          if p >= n and floor(p/10^(length(p)-length(n))) = n then return k fi
%p A197816        fi od od
%p A197816 end proc:
%p A197816 map(f, [$1..100]); # _Robert Israel_, Jun 04 2018
%Y A197816 Cf. A018800, A062584.
%K A197816 nonn,base,look
%O A197816 1,1
%A A197816 _Michel Lagneau_, Oct 18 2011