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.

A126805 "Class-" (or "class-minus") number of prime(n) according to the Erdős-Selfridge classification of primes.

This page as a plain text file.
%I A126805 #18 Mar 27 2024 08:01:23
%S A126805 1,1,1,1,2,1,1,1,3,2,2,1,2,2,4,2,3,2,3,2,1,2,3,3,1,2,2,3,1,2,2,2,2,4,
%T A126805 2,2,2,1,4,3,4,2,2,1,2,3,2,2,3,2,3,2,2,2,1,3,4,2,4,2,5,2,2,3,2,3,3,2,
%U A126805 4,3,3,5,3,3,2,3,2,3,2,2,3,2,3,1,2,2,2,2,4,3,4,3,1,2,4,3,3,2,3,2,2,5,3,3,2
%N A126805 "Class-" (or "class-minus") number of prime(n) according to the Erdős-Selfridge classification of primes.
%C A126805 This gives the "class-" number as opposed to the "class+" number. Not to be confused with the "class-number" of quadratic form theory.
%C A126805 a(n)=1 if A000040(n) is in A005109, a(n)=2 if A000040(n) is in A005110, a(n)=3 if A000040(n) is in A005111 etc.
%H A126805 T. D. Noe, <a href="/A126805/b126805.txt">Table of n, a(n) for n=1..10000</a>
%H A126805 <a href="/index/Pri#primes_Erdos_Selfridge">Index entries for sequences related to the Erdos-Selfridge classification</a>
%F A126805 a(n) = max { a(p)+1 ; prime(p) is > 3 and divides prime(n)-1 } union { 1 } - _M. F. Hasler_, Apr 16 2007
%p A126805 A126805 := proc(n)
%p A126805     option remember;
%p A126805     local p, pe, a;
%p A126805     if isprime(n) then
%p A126805         a := 1;
%p A126805         for pe in ifactors(n-1)[2] do
%p A126805             p := op(1, pe);
%p A126805             if p > 3 then
%p A126805                 a := max(a, procname(p)+1);
%p A126805             end if;
%p A126805         end do;
%p A126805         a ;
%p A126805     else
%p A126805         -1;
%p A126805     end if;
%p A126805 end proc:
%p A126805 seq(A126805(ithprime(n)),n=1..100) ;
%t A126805 a [n_] := a[n] = Module[{p, pf, e, res}, If[PrimeQ[n], pf = FactorInteger[n-1]; res = 1; For[e = 1, e <= Length[pf], e++, p = pf[[e, 1]]; If[p > 3, res = Max[res, a[p]+1]]]; Return[res], -1]]; Table[a[Prime[n]], {n, 1, 105}] (* _Jean-François Alcover_, Dec 13 2013, translated from Maple *)
%o A126805 (PARI) A126805(n) = { if( n>0, n=-prime(n)); if(( n=factor(-1-n)[,1] ) & n[ #n]>3, vecsort( vector( #n, i, A126805(-n[i]) ))[ #n]+1, 1) } \\ _M. F. Hasler_, Apr 16 2007
%Y A126805 Cf. A056637.
%K A126805 easy,nonn
%O A126805 1,5
%A A126805 _R. J. Mathar_, Feb 23 2007