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.

A278291 Numbers n such that n-1 has the same number of prime factors as n (with multiplicity).

Original entry on oeis.org

3, 10, 15, 22, 26, 28, 34, 35, 39, 45, 58, 76, 86, 87, 94, 95, 99, 117, 119, 122, 123, 125, 134, 136, 142, 143, 146, 148, 154, 159, 165, 171, 172, 175, 178, 202, 203, 206, 214, 215, 218, 219, 231, 245, 246, 254, 285, 286, 297, 299, 302, 303, 327, 333, 335, 351, 357, 362, 370, 376, 382, 388, 394, 395
Offset: 1

Views

Author

Ely Golden, Nov 16 2016

Keywords

Examples

			a(1)=3, as both 2 and 3 have 1 prime factor. a(2)=10, as both 9 and 10 have 2 prime factors. a(3)=15, as both 14 and 15 have 2 prime factors.
		

Programs

  • Java
    public class A278291{
    public static void main(String[] args)throws Exception{
        long dim0=numberOfPrimeFactors(2);//note that this method must be manually implemented by the user
        long dim1;
        long counter=3;
        long index=1;
        while(index<=10000){
          dim1=numberOfPrimeFactors(counter);
          if(dim1==dim0){System.out.println(index+" "+counter);index++;}
          dim0=dim1;
          counter++;
        }
      }
    }
    
  • Mathematica
    fQ[n_] := PrimeOmega[n - 1] == PrimeOmega[n]; Select[Range@400, fQ] (* Robert G. Wilson v, Nov 17 2016 *)
  • PARI
    is(n) = bigomega(n)==bigomega(n-1) \\ Felix Fröhlich, Nov 17 2016
  • SageMath
    def bigomega(x):
        s=0;
        f=list(factor(x));
        for c in range(len(f)):
            s+=f[c][1]
        return s;
    dim0=bigomega(2);
    counter=3
    index=1
    while(index<=10000):
        dim1=bigomega(counter);
        if(dim1==dim0):
            print(str(index)+" "+str(counter))
            index+=1;
        dim0=dim1;
        counter+=1;
    

Formula

a(n) = A045920(n) + 1. - Robert G. Wilson v, Nov 17 2016