OFFSET
0,5
COMMENTS
a(n) for prime n equals 1, but a value of 1 does not imply primality (e.g., a(9) = 1 but 9 is the square of a prime).
a(n) = 1 does imply the primality of n if n > 1260. (see Math StackExchange link)
a(n) can never exceed floor(n/2) for n > 1.
a(n) for even n greater than 2 can never equal 1.
LINKS
Antti Karttunen, Table of n, a(n) for n = 0..65537
Mathematics Stack Exchange, Does this sequence have this interesting property relating to the prime factorization of the index?, August 2012
EXAMPLE
For n = 6, we have a(n) = 3 as 2, 3, and 6 are greater than 1 and 1 = a(5).
MATHEMATICA
a[0] := 0; a[n_] := a[n] = Length[Select[Divisors[n], # > a[n - 1] &]]; Table[a[n], {n, 0, 99}] (* Alonso del Arte, Sep 24 2011 *)
PROG
(Java)
import java.util.Set; import java.util.TreeSet;
public class Seq1 { public static final int TOCALC = 50; public static void main(String[] args) { int[] terms = new int[TOCALC]; terms[0] = 0; terms[1] = 1; Set<Integer> uniqueFactors = new TreeSet<Integer>(); for(int n = 2; n <= TOCALC - 1; n++){ for(int i = 1; i <= n; i++){ if(n % i == 0){ uniqueFactors.add(i); } } int counter = 0; for(int test : uniqueFactors){ if(test > terms[n - 1]){ counter++; } } terms[n] = counter; uniqueFactors.clear(); } int newLine = 0; for(int d = 0; d <= TOCALC - 1; d++){ System.out.print(terms[d] + ", "); newLine++; if(newLine == 10){ System.out.println(); newLine = 0; } } int max = 0; for(int f = 0; f <= TOCALC - 1; f++){ max = Math.max(max, terms[f]); } System.out.println(); System.out.print("Max: " + max); }}
(PARI)
up_to = 105;
v152188 = vector(up_to);
v152188[1] = 1;
A152188(n) = if(n<=1, n, my(prev = v152188[n-1], res = sumdiv(n, d, (d>prev))); v152188[n] = res; (res)); \\ Must be called in order of increasing n.
for(n=0, up_to, print1(A152188(n), ", ")); \\ Antti Karttunen, Mar 06 2018
CROSSREFS
KEYWORD
nonn
AUTHOR
Christopher Williamson, Sep 24 2011
EXTENSIONS
More terms from Antti Karttunen, Mar 06 2018
STATUS
approved