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.

Showing 1-5 of 5 results.

A020465 Primes that contain digits 4 and 7 only.

Original entry on oeis.org

7, 47, 4447, 7477, 44777, 47777, 74747, 77447, 77477, 77747, 4444747, 4447747, 4747747, 4774477, 4774747, 7444477, 7447777, 7474477, 7477777, 7747477, 7774777, 7777447, 44447747, 44747447, 44747777, 44774777, 47447747, 47774477, 47774747
Offset: 1

Views

Author

Keywords

Crossrefs

Cf. A284971.

Programs

  • Magma
    [p: p in PrimesUpTo(47774747) | Set(Intseq(p)) subset [4, 7]]; // Vincenzo Librandi, Jul 27 2012
    
  • Mathematica
    Flatten[Table[Select[FromDigits/@Tuples[{4,7},n],PrimeQ],{n,8}]] (* Vincenzo Librandi, Jul 27 2012 *)
  • Python
    from sympy import isprime
    from itertools import count, takewhile
    def A284971(n):
      b = bin(n+1)[3:]
      return int("".join(b.replace("0", "4").replace("1", "7")))
    def aupto(limit):
      return list(filter(isprime, takewhile(lambda x: x <= limit, (A284971(n) for n in count(1)))))
    print(aupto(47774747)) # Michael S. Branicky, Apr 07 2021

A284973 Numbers with digits 4 and 9 only.

Original entry on oeis.org

4, 9, 44, 49, 94, 99, 444, 449, 494, 499, 944, 949, 994, 999, 4444, 4449, 4494, 4499, 4944, 4949, 4994, 4999, 9444, 9449, 9494, 9499, 9944, 9949, 9994, 9999, 44444, 44449, 44494, 44499, 44944, 44949, 44994, 44999, 49444, 49449, 49494, 49499, 49944, 49949
Offset: 1

Views

Author

Jaroslav Krizek, Apr 07 2017

Keywords

Crossrefs

Prime terms are in A020466.
Numbers with digits 4 and k only for k = 0 - 3 and 5 - 9: A169967 (k = 0), A032822 (k = 1), A284920 (k = 2), A032834 (k = 3), A256290 (k = 5), A284634 (k = 6), A284971 (k = 7), A284972 (k = 8), this sequence (k = 9).

Programs

  • Magma
    [n: n in [1..100000] | Set(IntegerToSequence(n, 10)) subset {4, 9}]
    
  • PARI
    a(n,{p=[4,9]})={my(v=binary(n+1));fromdigits(vector(#v-1,i,p[2]*v[i+1]+p[1]*!v[i+1]))} \\ R. J. Cano, Apr 09 2017

A284972 Numbers with digits 4 and 8 only.

Original entry on oeis.org

4, 8, 44, 48, 84, 88, 444, 448, 484, 488, 844, 848, 884, 888, 4444, 4448, 4484, 4488, 4844, 4848, 4884, 4888, 8444, 8448, 8484, 8488, 8844, 8848, 8884, 8888, 44444, 44448, 44484, 44488, 44844, 44848, 44884, 44888, 48444, 48448, 48484, 48488, 48844, 48848
Offset: 1

Views

Author

Jaroslav Krizek, Apr 07 2017

Keywords

Comments

All terms are even.

Crossrefs

Numbers with digits 4 and k only for k = 0 - 3 and 5 - 9: A169967 (k = 0), A032822 (k = 1), A284920 (k = 2), A032834 (k = 3), A256290 (k = 5), A284634 (k = 6), A284971 (k = 7), this sequence (k = 8), A284973 (k = 9).

Programs

  • Magma
    [n: n in [1..100000] | Set(IntegerToSequence(n, 10)) subset {4, 8}]
    
  • Mathematica
    Flatten@ Table[FromDigits /@ Tuples[{4, 8}, n], {n, 5}] (* Giovanni Resta, Apr 07 2017 *)
  • PARI
    a(n) = my (b = binary(1+n)); b[1] = 0; return (4*(10^(#b-1)-1)/(10-1) + (8-4)*fromdigits(b)) \\ Rémy Sigrist, Apr 08 2017
    
  • PARI
    a(n)={my(v=binary(n+1));v[1]=0;v+=vector(#v,i,i>1);4*fromdigits(v)} \\ R. J. Cano, Apr 08 2017
    
  • PARI
    a(n,{p=[4,8]})={my(v=binary(n+1));fromdigits(vector(#v-1,i,p[2]*v[i+1]+p[1]*!v[i+1]))} \\ R. J. Cano, Apr 09 2017

Formula

a(n) = 2 * A284920(n) = 4 * A032822(n).

A302938 Lexicographically first sequence of distinct terms such that the sum of any two terms is not a term of the sequence, and the sum of any two digits is not a digit of the sequence.

Original entry on oeis.org

1, 2, 4, 7, 44, 47, 74, 77, 444, 447, 474, 477, 744, 747, 774, 777, 4444, 4447, 4474, 4477, 4744, 4747, 4774, 4777, 7444, 7447, 7474, 7477, 7744, 7747, 7774, 7777, 44444, 44447, 44474, 44477, 44744, 44747, 44774, 44777, 47444, 47447, 47474, 47477, 47744, 47747, 47774, 47777, 74444, 74447
Offset: 1

Views

Author

Eric Angelini and Jean-Marc Falcoz, Apr 16 2018

Keywords

Comments

The full sequence uses digits 4 and 7 only, except for a(1) = 1 and a(2) = 2.

Examples

			1 + 2 = 3 and there is no term or digit 3 in the sequence;
1 + 4 = 5 and there is no term or digit 5 in the sequence;
1 + 7 = 8 and there is no term or digit 8 in the sequence;
2 + 4 = 6 and there is no term or digit 6 in the sequence;
2 + 7 = 9 and there is no term or digit 9 in the sequence;
4 + 4 = 8 and there is no term or digit 8 in the sequence;
4 + 7 = 11 and there is no term 11 in the sequence;
7 + 7 = 14 and there is no term 14 in the sequence;
etc.
		

Crossrefs

Cf. A302940 where the word “sum” is replaced by “product”.
Cf. A014261 which shares the same property (numbers that contain odd digits only).
Cf. A284971.

Formula

a(n) = A284971(n-2) for n>=3. - Alois P. Heinz, Jul 15 2023

A285011 Numbers with digits 7 and 9 only.

Original entry on oeis.org

7, 9, 77, 79, 97, 99, 777, 779, 797, 799, 977, 979, 997, 999, 7777, 7779, 7797, 7799, 7977, 7979, 7997, 7999, 9777, 9779, 9797, 9799, 9977, 9979, 9997, 9999, 77777, 77779, 77797, 77799, 77977, 77979, 77997, 77999, 79777, 79779, 79797, 79799, 79977, 79979
Offset: 1

Views

Author

Jaroslav Krizek, Apr 08 2017

Keywords

Crossrefs

Prime terms are in A020471.
Numbers with digits 7 and k only for k = 0 - 6 and 8 - 9: A204094 (k = 0), A276039 (k = 1), A284921 (k = 2), A143967 (k = 3), A284971 (k = 4), A284380 (k = 5), A256292 (k = 6), A256340 (k = 8), this sequence (k = 9).

Programs

  • Magma
    [n: n in [1..100000] | Set(IntegerToSequence(n, 10)) subset {7, 9}];
    
  • Mathematica
    Flatten@ Table[FromDigits /@ Tuples[{7, 9}, n], {n, 5}] (* Giovanni Resta, Apr 10 2017 *)
  • PARI
    a(n,{p=[7,9]})={my(v=binary(n+1));fromdigits(vector(#v-1,i,p[2]*v[i+1]+p[1]*!v[i+1]))} \\ R. J. Cano, Apr 09 2017
    
  • Python
    def a(n): return int(bin(n+1)[3:].replace('0', '7').replace('1', '9'))
    print([a(n) for n in range(1, 45)]) # Michael S. Branicky, Jul 09 2021
Showing 1-5 of 5 results.