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.

A225100 First occurrence of n in A225099, or -1 if n does not appear in A225099.

This page as a plain text file.
%I A225100 #11 Apr 29 2013 16:49:58
%S A225100 0,12,36,370,3770,12410,202130,197210,81770,9151610,16046810,12625730,
%T A225100 21899930,95336930,9549410,416392730,1016275130,338609570,789396530,
%U A225100 601741010,254885930,10083683090,4690939370,29207671610,30431277890,22264417370,23231920010,10838858810,37462976330
%N A225100 First occurrence of n in A225099, or -1 if n does not appear in A225099.
%C A225100 Least integer k representable as a sum of two distinct nontrivial prime powers (A025475 except the first term) in exactly n ways.
%t A225100 nn = 300000; p = Sort[Flatten[Table[Prime[n]^i, {n, PrimePi[Sqrt[nn]]}, {i, 2, Log[Prime[n], nn]}]]]; t =Sort[Select[Flatten[Table[p[[i]] + p[[j]], {i, Length[p] - 1}, {j, i + 1, Length[p]}]], # <= nn &]]; t2 = Table[Count[t, n], {n, 0, nn}]; n2 = Max[t2]; Table[Position[t2, n, 1, 1][[1, 1]], {n, 0, n2}] - 1(* _T. D. Noe_, Apr 29 2013 *)
%o A225100 (C)
%o A225100 #include <stdio.h>
%o A225100 #include <stdlib.h>
%o A225100 #define TOP (5ULL<<16)
%o A225100 typedef unsigned long long U64;
%o A225100 U64 *mem, pwFlat[TOP], primes[TOP]={2}, f[96];
%o A225100 int pp_compare(const void *p1, const void *p2) {
%o A225100   if (*(U64*)p1 == *(U64*)p2) return 0;
%o A225100   if (*(U64*)p1 < *(U64*)p2) return -1;
%o A225100   return 1;
%o A225100 }
%o A225100 int main() {
%o A225100   U64 i, j, k, p, pp=1, pfp;
%o A225100   mem = (U64*)malloc(3ULL<<30);
%o A225100   for (i = 3; i < TOP; i+=2) {
%o A225100     for (p = 0; p < pp; ++p)  if (i%primes[p] == 0) break;
%o A225100     if (p==pp)  primes[pp++] = i;
%o A225100   }
%o A225100   for (pfp = i = 0; i < pp; ++i)
%o A225100     for (j = primes[i]*primes[i]; j < TOP*TOP; j *= primes[i])
%o A225100       pwFlat[pfp++] = j;
%o A225100   for (k = i = 0; i < pfp; ++i)
%o A225100     for (j = i+1; j < pfp; ++j)
%o A225100       if ((p = pwFlat[i] + pwFlat[j]) < TOP*TOP) mem[k++] = p;
%o A225100   qsort(mem, k, 8, pp_compare);
%o A225100   p = mem[0];
%o A225100   for (i = j = mem[k] = 1; i <= k; ++i) {
%o A225100     if (p == mem[i])  { ++j; continue; }
%o A225100     if (j < 96 && f[j] == 0)  f[j] = p;
%o A225100     p = mem[i];
%o A225100     j = 1;
%o A225100   }
%o A225100   for (i = 0; i < 96; ++i)  printf("%llu, ", f[i]);
%o A225100   return 0;
%o A225100 }
%Y A225100 Cf. A225099.
%K A225100 nonn
%O A225100 0,2
%A A225100 _Alex Ratushnyak_, Apr 27 2013