Date: Sat, 3 Mar 2007 20:36:43 +0100 From: Richard Mathar (mathar(AT)strw.leidenuniv.nl) Maple programs to generate b005105.txt to b005108.txt, b081633.txt etc. ## Maple to generate b-files with Class+ 1 to ## Class+ 13 primes. ## Warning: to be run in an extra directory because it would overwrite ## the b090468.txt etc files which (as in the OEIS) may contain more ## terms than this here would produce in finite run-time. a := proc(n) option remember; local p,pf,e,res ; if isprime(n) then pf := ifactors(n+1)[2] ; res := 1 ; for e from 1 to nops(pf) do p := op(1,op(e,pf)) ; if p > 3 then res := max(res,a(p)+1) ; fi ; od ; RETURN(res) ; else -1 ; fi ; end: p := 2 : nA005105 := 1 : # Class 1+ nA005106 := 1 : # Class 2+ nA005107 := 1 : # Class 3+ nA005108 := 1 : # Class 4+ nA081633 := 1 : # Class 5+ nA081634 := 1 : # Class 6+ nA081635 := 1 : # Class 7+ nA081636 := 1 : # Class 8+ nA081637 := 1 : # Class 9+ nA081638 := 1 : # Class 10+ nA081639 := 1 : # Class 11+ nA084071 := 1 : # Class 12+ nA090468 := 1 : # Class 13+ nA14 := 1 : # Class 14+ not yet in OEIS nA15 := 1 : # Class 15+ not yet in OEIS nA16 := 1 : # Class 16+ not yet in OEIS for n from 1 to 2800000 do c := a(p) ; if c = 1 then fprintf("b005105.txt","%d %d\n",nA005105,p) ; nA005105 := nA005105+1 ; elif c = 2 then fprintf("b005106.txt","%d %d\n",nA005106,p) ; nA005106 := nA005106+1 ; elif c = 3 then fprintf("b005107.txt","%d %d\n",nA005107,p) ; nA005107 := nA005107+1 ; elif c = 4 then fprintf("b005108.txt","%d %d\n",nA005108,p) ; nA005108 := nA005108+1 ; elif c = 5 then fprintf("b081633.txt","%d %d\n",nA081633,p) ; nA081633 := nA081633+1 ; elif c = 6 then fprintf("b081634.txt","%d %d\n",nA081634,p) ; nA081634 := nA081634+1 ; elif c = 7 then fprintf("b081635.txt","%d %d\n",nA081635,p) ; nA081635 := nA081635+1 ; elif c = 8 then fprintf("b081636.txt","%d %d\n",nA081636,p) ; nA081636 := nA081636+1 ; elif c = 9 then fprintf("b081637.txt","%d %d\n",nA081637,p) ; nA081637 := nA081637+1 ; elif c = 10 then fprintf("b081638.txt","%d %d\n",nA081638,p) ; nA081638 := nA081638+1 ; elif c = 11 then fprintf("b081639.txt","%d %d\n",nA081639,p) ; nA081639 := nA081639+1 ; elif c = 12 then fprintf("b084071.txt","%d %d\n",nA084071,p) ; nA084071 := nA084071+1 ; elif c = 13 then fprintf("b090468.txt","%d %d\n",nA090468,p) ; nA090468 := nA090468+1 ; elif c = 14 then fprintf("b14.txt","%d %d\n",nA14,p) ; nA14 := nA14+1 ; elif c = 15 then fprintf("b15.txt","%d %d\n",nA15,p) ; nA15 := nA15+1 ; elif c = 16 then fprintf("b16.txt","%d %d\n",nA16,p) ; nA16 := nA16+1 ; fi ; #printf("%d %d %d\n",n,p,c) ; printf("%d %d %d\n",n,c) ; p := nextprime(p) : end: