login
This site is supported by donations to The OEIS Foundation.

 

Logo

Thanks to everyone who made a donation during our annual appeal!
To see the list of donors, or make a donation, see the OEIS Foundation home page.

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A232570 Numbers n such that n divides tribonacci(n) (A000073(n)). 3

%I

%S 1,8,16,19,32,47,53,64,103,112,128,144,155,163,192,199,208,221,224,

%T 256,257,269,272,299,311,368,397,401,419,421,448,499,512,587,599,617,

%U 640,683,757,768,773,784,863,883,896,907,911,929,936,991,1021,1024

%N Numbers n such that n divides tribonacci(n) (A000073(n)).

%C Inspired by A023172 (numbers n such that n divides Fibonacci(n)).

%C Includes all primes p such that x^3-x^2-x-1 has 3 distinct roots in the field GF(p). - _Robert Israel_, Feb 07 2018

%H Seiichi Manyama, <a href="/A232570/b232570.txt">Table of n, a(n) for n = 1..10000</a>

%p with(LinearAlgebra[Modular]):

%p T:= (n, m)-> MatrixPower(m, Mod(m, <<0|1|0>,

%p <0|0|1>, <1|1|1>>, float[8]), n)[1, 3]:

%p a:= proc(n) option remember; local k; if n=1

%p then 1 else for k from 1+a(n-1)

%p while T(k$2)>0 do od; k fi

%p end:

%p seq(a(n), n=1..70); # _Alois P. Heinz_, Feb 05 2018

%o (Ruby)

%o require 'matrix'

%o def power(a, n, mod)

%o return Matrix.I(a.row_size) if n == 0

%o m = power(a, n >> 1, mod)

%o m = (m * m).map{|i| i % mod}

%o return m if n & 1 == 0

%o (m * a).map{|i| i % mod}

%o end

%o def f(m, n)

%o ary0 = Array.new(m, 0)

%o ary0[0] = 1

%o v = Vector.elements(ary0)

%o ary1 = [Array.new(m, 1)]

%o (0..m - 2).each{|i|

%o ary2 = Array.new(m, 0)

%o ary2[i] = 1

%o ary1 << ary2

%o }

%o a = Matrix[*ary1]

%o mod = n

%o (power(a, n, mod) * v)[m - 1]

%o end

%o def a(n)

%o (1..n).select{|i| f(3, i) == 0}

%o end

%Y Cf. A000073, A023172.

%K nonn

%O 1,2

%A _Seiichi Manyama_, Jun 17 2016

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified January 16 19:49 EST 2019. Contains 319206 sequences. (Running on oeis4.)