OFFSET
3,1
EXAMPLE
Let n=3; then prime(n)=5. Since 5 == 2 (mod 3), i=2. So a(3) is the greatest length of a chain of consecutive primes p == 1 (mod 3) for which A261029(10*p) = 4 - 2 = 2. So these primes are in A272381. The first term is 7, and we have the chain of consecutive primes == 1 (mod 3): {7, 13, 19, 31, 37}. Since the following prime 43 == 1 (mod 3) is not in A272381, the chain ends and its length is 5. The second chain is the singleton {71}. So a(3)=5.
MATHEMATICA
a261029[n_]:=a261029[n]={x, y, z}/.{ToRules[Reduce[x^3+y^3+z^3-3 x y z==n&&0<=x<=y<=z&&z>=x+1, Integers]]}/.{x, y, z}->{};
data={};
Do[p=Prime[n];
primes=Select[Prime[Range[1+PrimePi[(2p)^2]]], Mod[#, 3]==1&];
tmp=Map[{#, Length[a261029[2 # p]]}&, primes];
AppendTo[data, {{n, 2p, 1+Mod[2p, 3]}, {{Length[#], Max[Map[Length, Select[Split[Differences[Flatten[Map[Position[primes, #, 1, 1]&, #]]]], #[[1]]==1&]]+1]}, #}&[Map[#[[1]]&, Select[tmp, #[[2]]==(1+Mod[2p, 3])&]]]}]; Print[Last[data]], {n, 3, 10}]
Map[Length[a261029[#]]&, Range[0, 20]] (* A261029 *)
Last[Last[data[[1]]]] (* A272381 *)
Last[Last[data[[2]]]] (* A272382 *)
Last[Last[data[[3]]]] (* A272384 *)
Last[Last[data[[4]]]] (* A272404 *)
Last[Last[data[[5]]]] (* A272406 *)
Last[Last[data[[6]]]] (* A272407 *)
Last[Last[data[[7]]]] (* A272409 *)
Map[#[[2]][[1]][[1]]&, data] (* A268665 *)
Map[#[[2]][[1]][[2]]&, data] (* A272856 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Vladimir Shevelev and Peter J. C. Moses, May 08 2016
STATUS
approved