Group Abstract Group Abstract

Message Boards Message Boards

0
|
7.3K Views
|
4 Replies
|
5 Total Likes
View groups...
Share
Share this post:

Is a number would be part of a series generated by LinearRecurrence?

Posted 5 years ago

Is there anyway to see if a number would be part of a series generated by a linearrecurrence?

Lets say the series is generated by

LinearRecurrence[{1, 0, 0, 0, 0, 0, 1, -1}, {3, 4, 5, 8, 11, 12, 13, 
  19}, {1, 20}]

and I want to determine if say 132858836366993 would be part of that series

POSTED BY: Paul Cleary
4 Replies
POSTED BY: Daniel Lichtblau
Posted 5 years ago

Daniel,

Thank you for your reply, and maybe in some future update a function would be available to do this, or even an extension to the existing function, just a thought.

POSTED BY: Paul Cleary

Paul,

Yes, I guess there is a way, but my approach is empirical - but mathematically non-rigorous.

You can construct a matrix mat

ker = {1, 0, 0, 0, 0, 0, 1, -1};
init = {3, 4, 5, 8, 11, 12, 13, 19};
mat = DiagonalMatrix[{1, 1, 1, 1, 1, 1, 1}, 1];
mat[[8]] = Reverse@ker;
mat // MatrixForm

enter image description here

which propagates your series for one term:

mat.init
(*  Out:  {4,5,8,11,12,13,19,20}  *)

Consequently the power of this matrix propagates for e.g. 10 terms:

mp = MatrixPower[mat, 10];
mp . init
(*  Out:  {24,27,28,29,35,36,37,40}  *)

The last line of this matrix gives the respective next term, and depending on the power this line shows a certain pattern:

Last /@ Table[MatrixPower[mat, n], {n, 1, 24}] // TableForm

enter image description here

From this it is easy to deduce a simple function to check if a number is an element of the series:

seriesMemberQ[z_] := MemberQ[(z - #)/16 & /@ Rest@init, _Integer]

So, lets check numbers in the neighbourhood of your number in question:

{#, seriesMemberQ[#]} & /@ Range[132858836366990, 132858836366999] // TableForm

enter image description here

The immediate answer is: No, your number 132858836366993 is not element of the series, sorry!

POSTED BY: Henrik Schachner
Posted 5 years ago

Henrik,

Thank you for your reply, it certainly solved my problem.

POSTED BY: Paul Cleary
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard